Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debugger into on dead process hangs image #5427

Closed
j-brant opened this issue Dec 30, 2019 · 3 comments · Fixed by #8373
Closed

debugger into on dead process hangs image #5427

j-brant opened this issue Dec 30, 2019 · 3 comments · Fixed by #8373

Comments

@j-brant
Copy link
Contributor

j-brant commented Dec 30, 2019

If you have a dead process in a debugger and press the Into, the image hangs. For example, if you evaluate

	| process context |
	process := [  ] newProcess.
	context := process suspendedContext.
	context pc: nil.
	process debug

and then hit the Into button, the image hangs. It appears that I get an ever growing stack of CompiledMethod(Object)>>at:. Here's the stack of one of my runs:

 ByteString(SequenceableCollection)>>do:
 ZnNewLineWriterStream(Stream)>>nextPutAll:
 ZnNewLineWriterStream(WriteStream)>>nextPutAll:
 Context>>printOn:
 ZnNewLineWriterStream(Stream)>>print:
 Context>>errorReportOn:
 [ :logger | 
logger
	nextPutAll: 'THERE_BE_DRAGONS_HERE';
	cr;
	nextPutAll: errMsg;
	cr.
"just print the error message if no context is given"
aContext ifNotNil: [ aContext errorReportOn: logger ].
" write some type of separator"
logger
	nextPutAll: (String new: 79 withAll: $-);
	cr;
	cr ] in SmalltalkImage>>logError:inContext:
 [ logStream := self openLog.
aMonadicBlock value: logStream ] in SmalltalkImage>>logDuring:
 BlockClosure>>ensure:
 SmalltalkImage>>logDuring:
 SmalltalkImage>>logError:inContext:
 [ Smalltalk logError: name inContext: interruptedContext ] in [ [ Smalltalk logError: name inContext: interruptedContext ]
	ifError: [  ] ] in DebugSession>>logStackToFileIfNeeded
 BlockClosure>>on:do:
 BlockClosure>>ifError:
 [ [ Smalltalk logError: name inContext: interruptedContext ]
	ifError: [  ] ] in DebugSession>>logStackToFileIfNeeded
 BlockClosure>>ensure:
 [ watchdog resume.	"start up the watchdog"
self
	ensure: [ "evaluate the receiver"
		theProcess := nil.	"it has completed, so ..."
		delay delaySemaphore signal	"arrange for the watchdog to exit" ] ] in BlockClosure>>valueWithin:onTimeout:
 BlockClosure>>on:do:
 BlockClosure>>valueWithin:onTimeout:
 DebugSession>>logStackToFileIfNeeded
 MorphicUIManager>>debugProcess:context:label:fullView:notification:
 MorphicUIManager(UIManager)>>debugProcess:context:label:fullView:
 Process>>debug:title:full:
 Process>>debug:title:
 SubscriptOutOfBounds(Exception)>>debug
 MorphicUIManager>>unhandledErrorDefaultAction:
 UnhandledError>>defaultAction
 UndefinedObject>>handleSignal:
 UnhandledError(Exception)>>signal
 UnhandledError class>>signalForException:
 SubscriptOutOfBounds(Error)>>defaultAction
 UndefinedObject>>handleSignal:
 SubscriptOutOfBounds(Exception)>>pass
 [ :ex | 
ActiveWorld := priorWorld.
ActiveEvent := priorEvent.
ActiveHand := priorHand.
ex pass ] in WorldMorph>>becomeActiveDuring:
 BlockClosure>>cull:
 Context>>evaluateSignal:
 Context>>handleSignal:
 SubscriptOutOfBounds(Exception)>>signal
 SubscriptOutOfBounds class>>signalFor:lowerBound:upperBound:in:
 SubscriptOutOfBounds class>>signalFor:lowerBound:upperBound:
 SubscriptOutOfBounds class>>signalFor:
 CompiledMethod(Object)>>errorSubscriptBounds:
 CompiledMethod(Object)>>at:
 CompiledMethod(Object)>>at:
...a few hundred more at: methods...
 CompiledMethod(Object)>>at:
 CompiledMethod(Object)>>at:
 CompiledMethod(SequenceableCollection)>>collect:
 SmallInteger(Number)>>adaptToCollection:andSend:
 CompiledMethod(Collection)>>//
 Context(InstructionStream)>>interpretNextV3PlusClosureInstructionFor:
 EncoderForV3PlusClosures class>>interpretNextInstructionFor:in:
 Context(InstructionStream)>>interpretNextInstructionFor:
 Context>>step
 [ self suspendedContext == aContext
	ifTrue: [ suspendedContext := suspendedContext step ]
	ifFalse: [ self complete: (self calleeOf: aContext) ] ] in Process>>step:
 BlockClosure>>ensure:
 Process>>evaluate:onBehalfOf:
 Process>>step:
 DebugSession>>stepInto:
 StepIntoDebugAction>>executeAction
 StepIntoDebugAction(DebugAction)>>execute
 [ self execute ] in StepIntoDebugAction(DebugAction)>>asGlamourAction
 BlockClosure>>glamourValueWithArgs:
 GLMGenericAction(GLMAction)>>actOn:
 GLMGenericAction(GLMAction)>>morphicActOn:
 GLMPluggableButtonMorph(PluggableButtonMorph)>>performAction:
 [ :m | 
(m containsPoint: evt cursorPoint)
	ifTrue: [ m enabled
			ifTrue: [ m performAction: evt ] ] ] in GLMPluggableButtonMorph(PluggableButtonMorph)>>mouseUp:
 Array(SequenceableCollection)>>do:
 GLMPluggableButtonMorph(PluggableButtonMorph)>>mouseUp:
 GLMPluggableButtonMorph(Morph)>>handleMouseUp:
 MouseButtonEvent>>sentTo:
 GLMPluggableButtonMorph(Morph)>>handleEvent:
 GLMPluggableButtonMorph(Morph)>>handleFocusEvent:
 [ ActiveHand := self.
ActiveEvent := anEvent.
result := focusHolder
	handleFocusEvent: (anEvent transformedBy: (focusHolder transformedFrom: self)) ] in HandMorph>>sendFocusEvent:to:clear:
 BlockClosure>>on:do:
 WorldMorph>>becomeActiveDuring:
 HandMorph>>sendFocusEvent:to:clear:
 HandMorph>>sendEvent:focus:clear:
 HandMorph>>sendMouseEvent:
 HandMorph>>handleEvent:
 HandMorph>>processEventsFromQueue:
 HandMorph>>processEvents
 [ :h | 
self activeHand: h.
h processEvents.
self activeHand: nil ] in WorldState>>doOneCycleNowFor:
 Array(SequenceableCollection)>>do:
 WorldState>>handsDo:
 WorldState>>doOneCycleNowFor:
 WorldState>>doOneCycleFor:
 WorldMorph>>doOneCycle
 WorldMorph class>>doOneCycle
 [ [ WorldMorph doOneCycle.
Processor yield.
false ] whileFalse: [  ] ] in MorphicUIManager>>spawnNewProcess
 [ self value.
Processor terminateActive ] in BlockClosure>>newProcess
@StephanEggermont
Copy link
Contributor

Yes, I've run into this problem too

@StevenCostiou StevenCostiou added this to To do in Debugger and Debugging via automation Jan 7, 2021
@StevenCostiou StevenCostiou moved this from To do to In progress in Debugger and Debugging Jan 7, 2021
@StevenCostiou
Copy link
Collaborator

Should we be able to step a dead context?

In P9, the debugger does not allows you to do that (buttons are disabled) - except that your examples highlights another bug in the debugger (will fix).

Did you step the dead context on purpose, and how should it work? Or would the stepping being disabled with a notification that you cannot step a dead context suffice?

@StephanEggermont
Copy link
Contributor

One click too many...

Debugger and Debugging automation moved this from In progress to Done Jan 15, 2021
@StevenCostiou StevenCostiou moved this from Done to Closed issues in Debugger and Debugging Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Debugger and Debugging
  
Closed issues
Development

Successfully merging a pull request may close this issue.

4 participants