squeak-smalltalk / squeak-object-memory

Issues and assets related to the Squeak object memory.
https://bugs.squeak.org
MIT License
11 stars 1 forks source link

Debugger Abandon MNU error #39

Closed isCzech closed 1 year ago

isCzech commented 2 years ago

The following example raises an error when you try to abandon or close the debugger:

If you run this in the Workspace: p := [ [Semaphore new wait] ensure: [1/0] ] fork And then terminate by hand in the Workspace: [p terminate] fork The ZeroDivide pops up as expected.

Now when you press Abandon (or just close the window) an MNU: doesNotUnderstand stepToCallee pops up.

If you repeat the example but instead of pressing Abandon you choose 'terminate process' from the debugger's window menu (the triangle in a blue circle), the window gets closed correctly, no error raised.

The issue is related to #terminateAggressively which takes care of Abandoning or closing the debugger. image

LinqLover commented 1 year ago

That's funny. I have not yet studied your latest implementation of Context>>#unwindTo:safely:, but somehow its coroutine logic (#runUntilReturnFrom:) seems to bite with the coroutines from my #terminateAggressively (#runUntilErrorOrReturFrom:) ... The ensure guard of the former is intercepting the unwind control flow of the latter. Not yet sure whom to blame for this ...

isCzech commented 1 year ago

Fix by Kernel-jar.1500 The root cause is #runUntilErrorOrReturnFrom: won't check for topContext == nil when doing topContext stepToCallee and #terminateAggressively won't check for suspendedContext == nil when doing suspendedContext privRefresh This happens because #terminateAggressively attempts to complete the whole stack including the bottom context.