Pharo 6 cannot parallel trace through same method

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Pharo 6 cannot parallel trace through same method

Ben Coman

This has bugged me a few times recently, so I've produced a demo.
Define...

  Object subclass: #AA
instanceVariableNames: ''
classVariableNames: ''
package: 'AAAA'

  AA>>test
self haltOnce.
self inform: 'I got here'.

then in playground evaluate....
  Halt resetOnce. "i.e. World > Debugging > Enable all break/inspect once."
  AA new test.

and as expected you get a debugger window.
Now once again without closing the debugger ...
  Halt resetOnce. 
  AA new test.

and I'd expect another debugger, but instead I'm informed 'I got here'.
Its extremely useful sometimes to parallel trace through code comparing two cases,
and the current behaviour prevents that. .

The Pharo 5 equivalent works as expected...
  Halt enableHaltOnce. 
  AA new test.

I'm not sure where to hang it, but the following test 
differentiates between Pharo 5 & 6. (you can also run it from the playground.)
 
 testParallelTrace
    |completed p1 ds1 p2 ds2|
    completed := 0. 
    Halt resetOnce. "enableHaltOnce"
    p1 := [ self haltOnce. completed := completed + 1 ] newProcess.
    ds1 := DebugSession named: 'Trace1' on: p1 startedAt: p1 suspendedContext.
    ds1 resume.
    Halt resetOnce. "enableHaltOnce"
    p2 := [ self haltOnce. completed := completed + 1 ] newProcess.
    ds2 := DebugSession named: 'Trace2' on: p2 startedAt: p2 suspendedContext.
    ds2 resume.
    self assert: (completed = 0) 

I've opened 

cheers -ben



P.S. I'm not sure if enabling the global haltOnce might cause issues.  
It would be useful to be able to set it only for the DebugSession.
Reply | Threaded
Open this post in threaded view
|

Re: Pharo 6 cannot parallel trace through same method

Nicolai Hess-3-2


2017-02-08 16:37 GMT+01:00 Ben Coman <[hidden email]>:

This has bugged me a few times recently, so I've produced a demo.
Define...

  Object subclass: #AA
instanceVariableNames: ''
classVariableNames: ''
package: 'AAAA'

  AA>>test
self haltOnce.
self inform: 'I got here'.

then in playground evaluate....
  Halt resetOnce. "i.e. World > Debugging > Enable all break/inspect once."
  AA new test.

and as expected you get a debugger window.
Now once again without closing the debugger ...
  Halt resetOnce. 
  AA new test.

and I'd expect another debugger, but instead I'm informed 'I got here'.
Its extremely useful sometimes to parallel trace through code comparing two cases,
and the current behaviour prevents that. .

The Pharo 5 equivalent works as expected...
  Halt enableHaltOnce. 
  AA new test.

I'm not sure where to hang it, but the following test 
differentiates between Pharo 5 & 6. (you can also run it from the playground.)
 
 testParallelTrace
    |completed p1 ds1 p2 ds2|
    completed := 0. 
    Halt resetOnce. "enableHaltOnce"
    p1 := [ self haltOnce. completed := completed + 1 ] newProcess.
    ds1 := DebugSession named: 'Trace1' on: p1 startedAt: p1 suspendedContext.
    ds1 resume.
    Halt resetOnce. "enableHaltOnce"
    p2 := [ self haltOnce. completed := completed + 1 ] newProcess.
    ds2 := DebugSession named: 'Trace2' on: p2 startedAt: p2 suspendedContext.
    ds2 resume.
    self assert: (completed = 0) 

I've opened 

cheers -ben


I think this is a result of the change how haltOnce are now implemented with metalinks.

 


P.S. I'm not sure if enabling the global haltOnce might cause issues.  
It would be useful to be able to set it only for the DebugSession.

Reply | Threaded
Open this post in threaded view
|

Re: Pharo 6 cannot parallel trace through same method

Denis Kudriashov
In reply to this post by Ben Coman
That's strange.

I found that if you step over halt then you are able to halt on next call. Anyway it needs to be fixed

2017-02-08 16:37 GMT+01:00 Ben Coman <[hidden email]>:

This has bugged me a few times recently, so I've produced a demo.
Define...

  Object subclass: #AA
instanceVariableNames: ''
classVariableNames: ''
package: 'AAAA'

  AA>>test
self haltOnce.
self inform: 'I got here'.

then in playground evaluate....
  Halt resetOnce. "i.e. World > Debugging > Enable all break/inspect once."
  AA new test.

and as expected you get a debugger window.
Now once again without closing the debugger ...
  Halt resetOnce. 
  AA new test.

and I'd expect another debugger, but instead I'm informed 'I got here'.
Its extremely useful sometimes to parallel trace through code comparing two cases,
and the current behaviour prevents that. .

The Pharo 5 equivalent works as expected...
  Halt enableHaltOnce. 
  AA new test.

I'm not sure where to hang it, but the following test 
differentiates between Pharo 5 & 6. (you can also run it from the playground.)
 
 testParallelTrace
    |completed p1 ds1 p2 ds2|
    completed := 0. 
    Halt resetOnce. "enableHaltOnce"
    p1 := [ self haltOnce. completed := completed + 1 ] newProcess.
    ds1 := DebugSession named: 'Trace1' on: p1 startedAt: p1 suspendedContext.
    ds1 resume.
    Halt resetOnce. "enableHaltOnce"
    p2 := [ self haltOnce. completed := completed + 1 ] newProcess.
    ds2 := DebugSession named: 'Trace2' on: p2 startedAt: p2 suspendedContext.
    ds2 resume.
    self assert: (completed = 0) 

I've opened 

cheers -ben



P.S. I'm not sure if enabling the global haltOnce might cause issues.  
It would be useful to be able to set it only for the DebugSession.

Reply | Threaded
Open this post in threaded view
|

Re: Pharo 6 cannot parallel trace through same method

Denis Kudriashov
Problem is related to RecursionStopper which not releases "stop method" while first debugger will be close or step over.
Also this "stop method" is Halt>>once which could be mistake. 

Probably RecoursionStopper should be process specific variable and not global registry.

2017-02-08 17:04 GMT+01:00 Denis Kudriashov <[hidden email]>:
That's strange.

I found that if you step over halt then you are able to halt on next call. Anyway it needs to be fixed

2017-02-08 16:37 GMT+01:00 Ben Coman <[hidden email]>:

This has bugged me a few times recently, so I've produced a demo.
Define...

  Object subclass: #AA
instanceVariableNames: ''
classVariableNames: ''
package: 'AAAA'

  AA>>test
self haltOnce.
self inform: 'I got here'.

then in playground evaluate....
  Halt resetOnce. "i.e. World > Debugging > Enable all break/inspect once."
  AA new test.

and as expected you get a debugger window.
Now once again without closing the debugger ...
  Halt resetOnce. 
  AA new test.

and I'd expect another debugger, but instead I'm informed 'I got here'.
Its extremely useful sometimes to parallel trace through code comparing two cases,
and the current behaviour prevents that. .

The Pharo 5 equivalent works as expected...
  Halt enableHaltOnce. 
  AA new test.

I'm not sure where to hang it, but the following test 
differentiates between Pharo 5 & 6. (you can also run it from the playground.)
 
 testParallelTrace
    |completed p1 ds1 p2 ds2|
    completed := 0. 
    Halt resetOnce. "enableHaltOnce"
    p1 := [ self haltOnce. completed := completed + 1 ] newProcess.
    ds1 := DebugSession named: 'Trace1' on: p1 startedAt: p1 suspendedContext.
    ds1 resume.
    Halt resetOnce. "enableHaltOnce"
    p2 := [ self haltOnce. completed := completed + 1 ] newProcess.
    ds2 := DebugSession named: 'Trace2' on: p2 startedAt: p2 suspendedContext.
    ds2 resume.
    self assert: (completed = 0) 

I've opened 

cheers -ben



P.S. I'm not sure if enabling the global haltOnce might cause issues.  
It would be useful to be able to set it only for the DebugSession.


Reply | Threaded
Open this post in threaded view
|

Re: Pharo 6 cannot parallel trace through same method

Stephane Ducasse-3
Indeed. (We should one of these days improve the concurrent aspect of Pharo but we should finish first the current open work)

On Wed, Feb 8, 2017 at 5:13 PM, Denis Kudriashov <[hidden email]> wrote:
Problem is related to RecursionStopper which not releases "stop method" while first debugger will be close or step over.
Also this "stop method" is Halt>>once which could be mistake. 

Probably RecoursionStopper should be process specific variable and not global registry.

2017-02-08 17:04 GMT+01:00 Denis Kudriashov <[hidden email]>:
That's strange.

I found that if you step over halt then you are able to halt on next call. Anyway it needs to be fixed

2017-02-08 16:37 GMT+01:00 Ben Coman <[hidden email]>:

This has bugged me a few times recently, so I've produced a demo.
Define...

  Object subclass: #AA
instanceVariableNames: ''
classVariableNames: ''
package: 'AAAA'

  AA>>test
self haltOnce.
self inform: 'I got here'.

then in playground evaluate....
  Halt resetOnce. "i.e. World > Debugging > Enable all break/inspect once."
  AA new test.

and as expected you get a debugger window.
Now once again without closing the debugger ...
  Halt resetOnce. 
  AA new test.

and I'd expect another debugger, but instead I'm informed 'I got here'.
Its extremely useful sometimes to parallel trace through code comparing two cases,
and the current behaviour prevents that. .

The Pharo 5 equivalent works as expected...
  Halt enableHaltOnce. 
  AA new test.

I'm not sure where to hang it, but the following test 
differentiates between Pharo 5 & 6. (you can also run it from the playground.)
 
 testParallelTrace
    |completed p1 ds1 p2 ds2|
    completed := 0. 
    Halt resetOnce. "enableHaltOnce"
    p1 := [ self haltOnce. completed := completed + 1 ] newProcess.
    ds1 := DebugSession named: 'Trace1' on: p1 startedAt: p1 suspendedContext.
    ds1 resume.
    Halt resetOnce. "enableHaltOnce"
    p2 := [ self haltOnce. completed := completed + 1 ] newProcess.
    ds2 := DebugSession named: 'Trace2' on: p2 startedAt: p2 suspendedContext.
    ds2 resume.
    self assert: (completed = 0) 

I've opened 

cheers -ben



P.S. I'm not sure if enabling the global haltOnce might cause issues.  
It would be useful to be able to set it only for the DebugSession.



Reply | Threaded
Open this post in threaded view
|

Re: Pharo 6 cannot parallel trace through same method

Denis Kudriashov
In reply to this post by Denis Kudriashov
I made fix with LocalRecursionStopper. Look at fogbugs.

2017-02-08 17:13 GMT+01:00 Denis Kudriashov <[hidden email]>:
Problem is related to RecursionStopper which not releases "stop method" while first debugger will be close or step over.
Also this "stop method" is Halt>>once which could be mistake. 

Probably RecoursionStopper should be process specific variable and not global registry.

2017-02-08 17:04 GMT+01:00 Denis Kudriashov <[hidden email]>:
That's strange.

I found that if you step over halt then you are able to halt on next call. Anyway it needs to be fixed

2017-02-08 16:37 GMT+01:00 Ben Coman <[hidden email]>:

This has bugged me a few times recently, so I've produced a demo.
Define...

  Object subclass: #AA
instanceVariableNames: ''
classVariableNames: ''
package: 'AAAA'

  AA>>test
self haltOnce.
self inform: 'I got here'.

then in playground evaluate....
  Halt resetOnce. "i.e. World > Debugging > Enable all break/inspect once."
  AA new test.

and as expected you get a debugger window.
Now once again without closing the debugger ...
  Halt resetOnce. 
  AA new test.

and I'd expect another debugger, but instead I'm informed 'I got here'.
Its extremely useful sometimes to parallel trace through code comparing two cases,
and the current behaviour prevents that. .

The Pharo 5 equivalent works as expected...
  Halt enableHaltOnce. 
  AA new test.

I'm not sure where to hang it, but the following test 
differentiates between Pharo 5 & 6. (you can also run it from the playground.)
 
 testParallelTrace
    |completed p1 ds1 p2 ds2|
    completed := 0. 
    Halt resetOnce. "enableHaltOnce"
    p1 := [ self haltOnce. completed := completed + 1 ] newProcess.
    ds1 := DebugSession named: 'Trace1' on: p1 startedAt: p1 suspendedContext.
    ds1 resume.
    Halt resetOnce. "enableHaltOnce"
    p2 := [ self haltOnce. completed := completed + 1 ] newProcess.
    ds2 := DebugSession named: 'Trace2' on: p2 startedAt: p2 suspendedContext.
    ds2 resume.
    self assert: (completed = 0) 

I've opened 

cheers -ben



P.S. I'm not sure if enabling the global haltOnce might cause issues.  
It would be useful to be able to set it only for the DebugSession.



Reply | Threaded
Open this post in threaded view
|

Re: Pharo 6 cannot parallel trace through same method

Ben Coman
I see its in 60383. Thx Denis.
cheers -ben

On Thu, Feb 9, 2017 at 5:29 PM, Denis Kudriashov <[hidden email]> wrote:

> I made fix with LocalRecursionStopper. Look at fogbugs.
>
> 2017-02-08 17:13 GMT+01:00 Denis Kudriashov <[hidden email]>:
>>
>> Problem is related to RecursionStopper which not releases "stop method"
>> while first debugger will be close or step over.
>> Also this "stop method" is Halt>>once which could be mistake.
>>
>> Probably RecoursionStopper should be process specific variable and not
>> global registry.
>>
>> 2017-02-08 17:04 GMT+01:00 Denis Kudriashov <[hidden email]>:
>>>
>>> That's strange.
>>>
>>> I found that if you step over halt then you are able to halt on next
>>> call. Anyway it needs to be fixed
>>>
>>> 2017-02-08 16:37 GMT+01:00 Ben Coman <[hidden email]>:
>>>>
>>>>
>>>> This has bugged me a few times recently, so I've produced a demo.
>>>> Define...
>>>>
>>>>   Object subclass: #AA
>>>> instanceVariableNames: ''
>>>> classVariableNames: ''
>>>> package: 'AAAA'
>>>>
>>>>   AA>>test
>>>> self haltOnce.
>>>> self inform: 'I got here'.
>>>>
>>>> then in playground evaluate....
>>>>   Halt resetOnce. "i.e. World > Debugging > Enable all break/inspect
>>>> once."
>>>>   AA new test.
>>>>
>>>> and as expected you get a debugger window.
>>>> Now once again without closing the debugger ...
>>>>   Halt resetOnce.
>>>>   AA new test.
>>>>
>>>> and I'd expect another debugger, but instead I'm informed 'I got here'.
>>>> Its extremely useful sometimes to parallel trace through code comparing
>>>> two cases,
>>>> and the current behaviour prevents that. .
>>>>
>>>> The Pharo 5 equivalent works as expected...
>>>>   Halt enableHaltOnce.
>>>>   AA new test.
>>>>
>>>> I'm not sure where to hang it, but the following test
>>>> differentiates between Pharo 5 & 6. (you can also run it from the
>>>> playground.)
>>>>
>>>>  testParallelTrace
>>>>     |completed p1 ds1 p2 ds2|
>>>>     completed := 0.
>>>>     Halt resetOnce. "enableHaltOnce"
>>>>     p1 := [ self haltOnce. completed := completed + 1 ] newProcess.
>>>>     ds1 := DebugSession named: 'Trace1' on: p1 startedAt: p1
>>>> suspendedContext.
>>>>     ds1 resume.
>>>>     Halt resetOnce. "enableHaltOnce"
>>>>     p2 := [ self haltOnce. completed := completed + 1 ] newProcess.
>>>>     ds2 := DebugSession named: 'Trace2' on: p2 startedAt: p2
>>>> suspendedContext.
>>>>     ds2 resume.
>>>>     self assert: (completed = 0)
>>>>
>>>> I've opened
>>>>
>>>> https://pharo.fogbugz.com/f/cases/19677/Cannot-parallel-trace-through-same-method
>>>>
>>>> cheers -ben
>>>>
>>>>
>>>>
>>>> P.S. I'm not sure if enabling the global haltOnce might cause issues.
>>>> It would be useful to be able to set it only for the DebugSession.
>>>
>>>
>>
>