[squeak-dev] [crash] segmentation violation on window resize

Marcel Taeumel marcel.taeumel at hpi.de
Wed Apr 27 16:33:15 UTC 2022

Ha. I think I found something. See Graphics-mt.514. I am not 100% sure that this was the culprit but I will backport it to Squeak 5.3 just in case.

Am 27.04.2022 13:37:45 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
Hi Lauren, hi all --

Okay, I give up on this for now. I cannot reliably reproduce the issue.

My only hypothesis is that we do something wrong with freeing the current Metal texture in sqSqueakOSXMetalView.m:449. Maybe we should tell the Metal framework about this and not just free the pointer... Reading the Metal documentation might help...

At least, the segfault always occurs in the same situation:

1. App window size changed.
2. Morphic ui process detects this via DisplayScreen class>checkForNewScreenSize 
3. The next call to DisplayScreen(Form)>boundingBox triggers a vmIOProcessEvents() in the regular interpreter loop via checkForEventsMayContextSwitch().
4. A display event will be processed ending up in sqSqueakOSXMetalView loadTexturesSubRectangle:
5. The texture update fails in sqSqueakOSXMetaView.m:439.

Nothing of that is out of the ordinary. The tuple (displayBits, displayWidth, displayHeight) seems correct. This leaves the way we free the old texture and allocate a new one.

Am 27.04.2022 11:58:31 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
Hi Lauren --

Nope. It just happened by chance. And only in a -f build. Hmm...

   DisplayScreen setNewScreenSize: (1024 at 768) * 1.´
   self currentWorld doOneCycle.
   DisplayScreen setNewScreenSize: (1024 at 768) * 2.
   self currentWorld doOneCycle.

] repeat.

Maybe it is a (Metal) texture allocating/freeing issue ...

Am 27.04.2022 10:45:02 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
Hi Lauren --

Thanks for reporting this. I was able to reproduce the issue. I am looking into it right now.

Am 27.04.2022 07:12:41 schrieb Lauren Pullen <drurowin at gmail.com>:
Hi List,

What the subject line says. I had just toggled the UI scale between
200% and 300% and back again and the window had shrunk, so I resized it
to maximize it again and the VM aborted.

The the last call from the VM was in
-[sqSqueakOSXMetalView loadTexturesSubRectangle:]
-[sqSqueakOSXMetalView drawRect:]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220427/27b80a2b/attachment-0001.html>

More information about the Squeak-dev mailing list