<br><br><div class="gmail_quote">On Mon, Mar 7, 2011 at 8:49 AM, Boudewijn Rempt <span dir="ltr">&lt;<a href="mailto:boud@valdyas.org">boud@valdyas.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
These tests fail:<br>
<br>
         63 - krita-image-KisIteratorTest (Failed)<br>
<br>
*** glibc detected *** ./KisIteratorTest: malloc(): memory corruption: 0x117d6ae8 ***<br>
QFATAL : KisIteratorTest::stressTest() ASSERT failure in QMutexLocker: &quot;QMutex pointer is misaligned&quot;, file /usr/include/QtCore/qmutex.h, line 100<br>
FAIL!  : KisIteratorTest::stressTest()<br clear="all"></blockquote></div><br>Well, i&#39;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 ;)<br>
<br>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 &quot;allow&quot; it, it will be quite difficult to make them do anything sane while this shift. So this &quot;allow&quot; will probably just mean &quot;do not crash&quot;. <br>
<br>As an alternative, we can define that such shifts are not allowed at all, because their &quot;write area&quot; includes the entire device. It would be quite sane decision, as such a rule would correspond to the guarantee rule of the data manager: &quot;you can read/write to any area of the device unless &quot;write areas&quot; have no intersections with areas of any type&quot;. And if we decide to do things this way, we need to add some asserts to iterators code to catch this kind of problems.<br>
<br>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 &quot;officially&quot; not allowed to write to the same areas of the data manager, it doesn&#39;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...<br>
<br>-- <br>Dmitry Kazakov<br>