[Pharo-dev] Puzzled

Pharo4Stef pharo4Stef at free.fr
Thu Apr 3 15:05:50 EDT 2014


When I use 

| context process |
context := [ 20 factorial ] asContext.

process := Process 
		forContext: context
		priority: Processor userInterruptPriority.
[  
	debugger := Smalltalk tools debugger new
						process: process
						controller: nil
						context: context.
	debugger stack expand.
	
] ifCurtailed: [ process terminate]

I do not get any extra process hanging around.

now if I do 



| context process |
context := [ 20 factorial ] asContext.

process := Process 
		forContext: context
		priority: Processor userInterruptPriority.
[  
	debugger := Smalltalk tools debugger new
						process: process
						controller: nil
						context: context.
	debugger stack expand.
	Transcript show: debugger stack selectedIndex
	
] ifCurtailed: [ process terminate]


But then when I do 


| context process debuggerg |
context := [ 20 factorial ] asContext.

process := Process 
		forContext: context
		priority: Processor userInterruptPriority.
[  
	debugger := Smalltalk tools debugger new
						process: process
						controller: nil
						context: context.
	debugger stack expand.
	Transcript show: debugger stack selectedIndex; cr.
] ensure: [ process terminate]

I get processes stuck trying to open the log fiel ro something like that.


Now I do not understand because when I ask the setter to stack (to get what is set in this variable) the system 
tells me that there is no store. 

Stef



On 03 Apr 2014, at 20:49, Pharo4Stef <pharo4Stef at free.fr> wrote:

> 
> even using ensure: to make sure that the process is terminated it is not really working.
> I have the impression that there is a problem and that the tests does not really finishes but this is really difficult to debug.
> 
>> Hi guys
>> 
>> I need your brain cells.
>> 
>> When I execute the test 
>> 
>> testBasic
>> 	| context process debugger printedString |
>> 	context := [ 20 factorial ] asContext.
>> 
>> 	process := Process 
>> 		forContext: context
>> 		priority: Processor userInterruptPriority.
>> 
>> 	debugger := Smalltalk tools debugger new
>> 						process: process
>> 						controller: nil
>> 						context: context.
>> 	debugger stack expand.
>> 
>> 	self assert: debugger stack selectedIndex = 1.
>> 	printedString := OpalCompiler isActive 
>> 		ifTrue: [	'[ 20 factorial ] in DebuggerTest>>testBasic']
>> 		ifFalse: [  '[...] in DebuggerTest>>testBasic' ]. 
>> 	self assert: debugger stack selectedItem printString = printedString.
>> 	
>> 	debugger send.
>> 	debugger send.
>> 	self assert: debugger code getText = (Integer>>#factorial) sourceCode.
>> 	self assert: debugger stack selectedItem printString =  'SmallInteger(Integer)>>factorial'.
>> 
>> two times my image (latest get totally unusable). 
>> I thought that may be the process should be terminated 
>> so I added 
>> 
>> 	process terminate
>> 
>> But nothing changes. I tried to debug the code but not chance.
>> I tried self halt after [ 20 factorial ] asContext.
>> 
>> I tried to execute the beginning in a workspace and not as a test to eliminate problem.
>> But again no chance.
>> 
>> 
>> So did I miss something obvious?
>> 
>> Stef
>> 	
>> 
>> 
>> 
>> 
> 
> 





More information about the Pharo-dev mailing list