<div dir="ltr"><div>To trigger the failure, just do this:</div><div><br></div><div>    BitmapStreamTests new testShortIntegerArrayReadRefStream2.</div><div><br></div><div>The source code of BitBlt hack in ShortIntegerArray>>restoreEndianness sounds correct.</div><div>The assertion failure occurs when destX < sourceX - presumably a case when hDir = 1 (see checkSourceOverlap).</div><div><br></div><div>I used LLDB rather than simulation to find it fast, but now it would be easier to just run VM simulation</div><div>Here are the details:</div><div>1) I tried LLDB conditional break, but it's awfully slow</div><div>2) I modified generated source code and compiled the hardcoded condition:</div><div>   2131                              /* pick up next word */ if( ((usqInt)sourceIndex) >= endOfSource )<br>   2132                                assert((((usqInt)sourceIndex)) < endOfSource);</div><div>3) launch lldb, set the breaskpoint<br></div><div>(lldb) br se -f BitBltPlugin.c -l 2132</div><div>(lldb) run ../../image/trunk6-64.image</div><div>3) I ran the SUnit tests...</div><div><br></div><div>Process 83691 launched: '/Users/nicolas/Smalltalk/OpenSmalltalk/opensmalltalk-vm/build.macos64x64/squeak.cog.spur/SqueakDebug.app/Contents/MacOS/Squeak' (x86_64)<br>Process 83691 stopped<br>* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1<br>    frame #0: 0x0000000100186871 Squeak`copyLoop at BitBltPlugin.c:2132<br>   2129                             destMask = mask1;<br>   2130    <br>   2131                             /* pick up next word */ if( ((usqInt)sourceIndex) >= endOfSource )<br>-> 2132                               assert((((usqInt)sourceIndex)) < endOfSource);<br>   2133                            thisWord = long32At(sourceIndex);<br>   2134                            sourceIndex += hInc;<br>   2135 <br>Target 0: (Squeak) stopped.</div><div>(lldb) bt<br>* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1<br>  * frame #0: 0x0000000100186871 Squeak`copyLoop at BitBltPlugin.c:2132<br>    frame #1: 0x0000000100182b81 Squeak`copyBitsLockedAndClipped at BitBltPlugin.c:1595<br>    frame #2: 0x000000010017fba6 Squeak`copyBits at BitBltPlugin.c:1257<br>    frame #3: 0x000000010017fea3 Squeak`primitiveCopyBits at BitBltPlugin.c:5115<br>    frame #4: 0x000000010000cd2d Squeak`interpret at gcc3x-cointerp.c:6192<br>    frame #5: 0x0000000100022196 Squeak`enterSmalltalkExecutiveImplementation at gcc3x-cointerp.c:16192<br>    frame #6: 0x0000000100001657 Squeak`interpret at gcc3x-cointerp.c:2761<br>    frame #7: 0x000000010015e477 Squeak`-[sqSqueakMainApplication runSqueak](self=0x00000001018091d0, _cmd="runSqueak") at sqSqueakMainApplication.m:201<br>    frame #8: 0x00007fff41cd87b8 Foundation`__NSFirePerformWithOrder + 360<br>    frame #9: 0x00007fff3fb4df57 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23<br>    frame #10: 0x00007fff3fb4de7f CoreFoundation`__CFRunLoopDoObservers + 527<br>    frame #11: 0x00007fff3fb303f8 CoreFoundation`__CFRunLoopRun + 1240<br>    frame #12: 0x00007fff3fb2fc93 CoreFoundation`CFRunLoopRunSpecific + 483<br>    frame #13: 0x00007fff3ee1ad96 HIToolbox`RunCurrentEventLoopInMode + 286<br>    frame #14: 0x00007fff3ee1aa0f HIToolbox`ReceiveNextEventCommon + 366<br>    frame #15: 0x00007fff3ee1a884 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 64<br>    frame #16: 0x00007fff3d0caa73 AppKit`_DPSNextEvent + 2085<br>    frame #17: 0x00007fff3d860e34 AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044<br>    frame #18: 0x00007fff3d0bf885 AppKit`-[NSApplication run] + 764<br>    frame #19: 0x00007fff3d08ea72 AppKit`NSApplicationMain + 804<br>    frame #20: 0x0000000100158086 Squeak`main(argc=2, argv=0x00007ffeefbff910, envp=0x00007ffeefbff928) at main.m:74<br>    frame #21: 0x00007fff67a5d015 libdyld.dylib`start + 1</div><div>(lldb) call printCallStack()<br>    0x7ffeefbd21e8 I ShortIntegerArray>restoreEndianness 0x1083e30e8: a(n) ShortIntegerArray<br>    0x7ffeefbd2248 I ReadStream(PositionableStream)>nextWordsInto: 0x108377710: a(n) ReadStream<br>    0x7ffeefbd2298 I ShortIntegerArray class(ArrayedCollection class)>newFromStream: 0x1089b2bf0: a(n) ShortIntegerArray class<br>    0x7ffeefbd22f0 M ReferenceStream(DataStream)>readWordLike 0x108377738: a(n) ReferenceStream<br>    0x7ffeefbd2360 I ReferenceStream(DataStream)>next 0x108377738: a(n) ReferenceStream<br>    0x7ffeefbd23c8 I ReferenceStream>next 0x108377738: a(n) ReferenceStream<br>    0x7ffeefbd2420 I BitmapStreamTests>testShortIntegerArrayReadRefStream2 0x1083775e0: a(n) BitmapStreamTests<br>snip...<br></div><div><br></div><div>(lldb) print skew<br>(sqInt) $25 = -24<br>(lldb) print preload<br>(sqInt) $26 = 1</div><div>(lldb) print hDir<br>(sqInt) $14 = 1</div><div><br></div><div>It seems to me that it's got something to do with 64bits shifter...<br></div><div>No time to simulate the VM now, if someone want to take it, it's a good exercize...</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 3 sept. 2019 à 23:44, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div>while running a debug squeak.cog.spur macos x64, I noticed repeated logs in console:<br></div><div><br></div><div>> (((usqInt)sourceIndex)) < endOfSource 2132</div><div><br></div><div>This corresponds to failing assert: in BitBltSimulation slang</div><div><br></div><div>    srcLongAt: idx<br>                <inline: #always><br>               self assert: idx asUnsignedInteger < endOfSource.<br>          ^self long32At: idx</div><div><br></div><div>Maybe it's a well known bug, but it's easy to trigger if you are after it:</div><div>Open Squeak5.1-16548-64bit.image (I took that of nsboot while testing failing Newspeak bootstrap <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/tests/newspeakBootstrap.sh" target="_blank">https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/tests/newspeakBootstrap.sh</a>)</div><div>Open TestRunner and run all tests...</div><div><br></div></div>
</blockquote></div>