our failing unittests...
Dmitry Kazakov
dimula73 at gmail.com
Mon Mar 7 10:47:14 CET 2011
On Mon, Mar 7, 2011 at 8:49 AM, Boudewijn Rempt <boud at valdyas.org> wrote:
> These tests fail:
>
> 63 - krita-image-KisIteratorTest (Failed)
>
> *** glibc detected *** ./KisIteratorTest: malloc(): memory corruption:
> 0x117d6ae8 ***
> QFATAL : KisIteratorTest::stressTest() ASSERT failure in QMutexLocker:
> "QMutex pointer is misaligned", file /usr/include/QtCore/qmutex.h, line 100
> FAIL! : KisIteratorTest::stressTest()
>
Well, i'm actually not sure what we should do with this test. The stress
test was added to prove that atm noone can shift the device while someone is
reading it. And the test proves it, obviously ;)
The problem is, we need to make a decision on how our iterators should work:
either they allow interleaving shift or not. Even if we say they "allow" it,
it will be quite difficult to make them do anything sane while this shift.
So this "allow" will probably just mean "do not crash".
As an alternative, we can define that such shifts are not allowed at all,
because their "write area" includes the entire device. It would be quite
sane decision, as such a rule would correspond to the guarantee rule of the
data manager: "you can read/write to any area of the device unless "write
areas" have no intersections with areas of any type". And if we decide to do
things this way, we need to add some asserts to iterators code to catch this
kind of problems.
The thing that bothers me the most is that the rule for the data manager is
quite flexible in comparison to the second solution for the problem. Even
though it is "officially" not allowed to write to the same areas of the data
manager, it doesn't check for this and does not crash. It simply works,
writes whatever you say to him =) So I wonder whether the same approach
might be good for the iterators...
--
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20110307/4c0296db/attachment.htm
More information about the kimageshop
mailing list