[squeak-dev] Bug in Process>>#terminate | Returning from unwind contexts

Jaromir Matas m at jaromir.net
Sat Mar 13 16:43:34 UTC 2021


Hi Christoph and all,

What is the expected semantics of the Debugger's Abandon? To quit and do
nothing more to the debugged process or continue unwinding?

I thought the former was right but the Debugger does the latter. Is it
really necessary to run all unwinds when closing the abandoned Debugger
window?

Because that is the cause of the Unwind errors... Normally, when hitting
Abandon, the debugged process terminates and the current UI continues.

But if there are unfinished unwinds in the debugged process and we hit
Abandon, the control jumps from the UI process to the debugged one (as
Christoph described) and stays there as an active UI process which creates
an impossible situation where we have:

- an active process being the former debugged one which is not the real
active one but only referred to as an effective process
- the real active process (genuine process) is the UI process previously
controlling the debugging with the effective process variable set
- this real active process is even erroneously answering true to
#isTerminated (because it's not 'active' and its suspendedContext is nil)
- and this real active process will eventually become the active UI again...
- and all this further leads to two simultaneous UI processes alternating
control... and more... a nightmare ;)

Check the enclosed printscreen...
<http://forum.world.st/file/t372955/After_NLR_mixup_-_genuine2.png> 

Long story short if I'm not wrong and the Debugger shouldn't do all the
unwinds when Abandoned, then the fix is a oneliner:
(Instead of termintating the debugged process via #terminate which runs the
unwinds, let's just 'make it' terminated)

Debugger >> windowIsClosing
	"My window is being closed; clean up. Restart the low space watcher."

	interruptedProcess == nil ifTrue: [^ self].
>>>	"Now terminate the interruptedProcess but without unwinds!"
>>>	interruptedProcess suspendedContext terminate.
	interruptedProcess := nil.
	
	contextStack := nil.
	receiverInspector := nil.
	contextVariablesInspector := nil.
	Smalltalk installLowSpaceWatcher.  "restart low space handler"


Thanks,



-----
^[^ Jaromir
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html


More information about the Squeak-dev mailing list