The following issue arose during the last few days. On current 64bit Squeak bundles, when setting a morph to an x position being (2 raisedTo: 31) in a world having an InfiniteForm, the VM crashes with a SegFault. This does not happen with (2 raisedTo: 32) or (2 raisedTo: 30). So far I was able to reproduce this on Windows and Linux (have not checked Mac yet). I tried to boil it down to the BitBlt call that causes this with the second example. At the bottom I have attached an example crash.dmp. This does not happen on 32bit bundles. "Execute this in a World with a texture (InfiniteForm) background"
m := CircleMorph new openInWorld.
m position: (2 raisedTo: 31)@100. patternForm := Form extent: 3 @ 3 depth: 32.
port := GrafPort new.
port setDestForm: Display.
port sourceForm: sourceForm.
port fillColor: nil.
port combinationRule: Form paint.
port sourceRect: (0@0 extent: patternForm boundingBox extent).
port destOrigin: (2 raisedTo: 31)@100.
port copyBits.
— |
I was able to reproduce the crash on macOS with — |
In reply to this post by David T Lewis
2^31 is most certainly a signed int overflow. it is not representable on 32 bits and will wrap to -2^31. Then, it will most probably result in buffer overflow (or underflow). If I compile debug VM with
— |
In reply to this post by David T Lewis
The signed integer overflow reported by -fsanitize is not related, what is related is the assert warning:
One solution is to change the type of dx and dy to sqInt. — |
In reply to this post by David T Lewis
I cannot prove that I fixed each and every possible edge case, code is way too complex for human analysis! — |
In reply to this post by David T Lewis
Closed #447. — |
In reply to this post by David T Lewis
Thx Nicolas — |
In reply to this post by David T Lewis
Thanks Nicolas! — |
Free forum by Nabble | Edit this page |