Trouble with valgrind'ing Krita
Dmitry Kazakov
dimula73 at gmail.com
Tue Jul 13 15:42:15 CEST 2010
Hi!
I have a trouble - i can't run release build of Krita under valgrind (any
tool). When i try to do it - it crashes with on the first stroke. The crash
can be reproduced for valgrind'ing several tests:
./image/tests/KisAsyncMergerTest
./image/tests/KisUpdateSchedulerTest
All of them crash with the following output from valgrind:
http://pastebin.com/73ufemy5
If i try to run krita itself -- the backtrace changes:
http://pastebin.com/H1hfx9zy
Well, i don't know what to do with it, i tried every way i could...
How to reproduce:
1) Just compile krita in non-debug mode, that is: RelWithDebInfo or Release
(In Debug it works fine without any crashes).
2) And run tests under valgrind:
valgrind KisAsyncMergerTest
valgrind KisUpdateSchedulerTest
One observation:
There is some race condition, i think. But krita's threads seem to be
innocent, because i tried to switch-off the pooler thread and run
./KisAsyncMerger test, that is single-threaded - it crashes.
How to prove, that there is a race: just add some delay into
KoCompositeOpAlphaDarken.h and KoCompositeOpAlphaBase and the crash
disappears, e.g.:
void composite(quint8 *dstRowStart,
qint32 dststride,
const quint8 *srcRowStart,
qint32 srcstride,
const quint8 *maskRowStart,
qint32 maskstride,
qint32 rows,
qint32 cols,
quint8 U8_opacity,
const QBitArray & channelFlags) const {
qint32 srcInc = (srcstride == 0) ? 0 : _CSTraits::channels_nb;
channels_type opacity = KoColorSpaceMaths<quint8,
channels_type>::scaleToA(U8_opacity);
while (rows > 0) {
const channels_type *srcN = reinterpret_cast<const channels_type
*>(srcRowStart);
channels_type *dstN = reinterpret_cast<channels_type
*>(dstRowStart);
const quint8 *mask = maskRowStart;
qint32 columns = cols;
//add this line or simple qDebug()
usleep(500);
....
}
}
Do you have any idea, what is this? Maybe, there is a bug in valgrind? If
the latter is true, we need a reduction test, that shows this bug. Maybe i
have some strange system packages?
If it runs fine on your system, could you send me your CMakeCache.txt and
versions of gcc and valgrind?
--
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20100713/134d4425/attachment.htm
More information about the kimageshop
mailing list