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

Jaromir Matas m at jaromir.net
Thu Mar 11 09:39:13 UTC 2021


Hi Christoph, hi all,

There's a couple of (probably) independent issues:

1. broken #isTerminated - fix suggested in the previous post, will send to
The Inbox

2. Debugger leaving unterminated processes behind (see in Process Browser).
The problem is in my view in Debugger >> windowIsClosing:

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

		interruptedProcess == nil ifTrue: [^ self].
		interruptedProcess terminate.

>>>	at this point the interruptedProcess may still not be terminated, so I
suggest to replace the above line by:

>>>		[interruptedProcess isTerminated] whileFalse: [interruptedProcess
terminate].

		interruptedProcess := nil.
		
		contextStack := nil.
		receiverInspector := nil.
		contextVariablesInspector := nil.
		Smalltalk installLowSpaceWatcher.  "restart low space handler"

This patch would cleanup unterminated processes when closing the debugger
and resolve my examples without non-local returns but your example with
non-local return would still remain unresolved.

Note: I know nothing about the Debugger so take my patch as a desperate
attempt :)

3. your fix `ctxt restart` applied for this recursive scenario:

	x:=nil. [self error: 'x1'] ensure: [
			[self error: 'x2'] ensure: [
				[self error: 'x3'] ensure: [x:=3]. 
				x:=2]. 
			x:=1].

... leads me to a question what the expected beahvior actually is: If you
Abandon the FIRST error debugger - do you expect to continue to the second
debugger, abandon it and continue to the third debugger or rather quit right
after the FIRST debugger Abandon? If the former then what would the
difference between Proceed and Abandon be? I'm no longer sure of anything :)
Your fix leads to the former.

Please let me know what you think.
Thanks,




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


More information about the Squeak-dev mailing list