About the infinite debugger

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

About the infinite debugger

Guillermo Polito
Hi all,

during today's sprint we have been working with lots of people on the infinite debugger problem (https://pharo.fogbugz.com/f/cases/22085/). We have checked the emails sent in the latest month. Then, together with Quentin, Pablo, Pavel, Yoan we have been discussing and testing hypothesis all day. We have been also comparing the debuggers code between pharo 3/4 (where the bug was is present) and pharo 7, but this was not necessarily straight forward as the code is not the same and there is no easy diff...

AAAAND, we have found that the problem may come from a wrong pragma marker. Just removing that pragma gives us back the same behaviour as in  Pharo 3/4. :D


I know that the exception handling/debugging has been modified several times in the latest years (some refactorings, hiding contexts...), we unfortunately don't have tests for it, so I'd like some more pair of eyes on it. Ben, Martin could you take a look?

Thanks all for the fish,
Guille
Reply | Threaded
Open this post in threaded view
|

Re: [rmod] About the infinite debugger

Clément Béra
Hi,

Normally the pull request should break the exception tests, especially the ones with nested handler, since they are the reason 199 marked signalling contexts were introduced.

Looking quickly this test in latest Pharo 7 for example:
ExceptionTests>>testHandlerContext
fails with the pull request.

Since the pull request changes a green test into a red test, I don't understand why you say "we unfortunately don't have tests for it". I don't understand either why you say this pragma is "wrong", so I can't help with that either.

Best,

On Fri, Jun 29, 2018 at 4:48 PM, Guillermo Polito <[hidden email]> wrote:
Hi all,

during today's sprint we have been working with lots of people on the infinite debugger problem (https://pharo.fogbugz.com/f/cases/22085/). We have checked the emails sent in the latest month. Then, together with Quentin, Pablo, Pavel, Yoan we have been discussing and testing hypothesis all day. We have been also comparing the debuggers code between pharo 3/4 (where the bug was is present) and pharo 7, but this was not necessarily straight forward as the code is not the same and there is no easy diff...

AAAAND, we have found that the problem may come from a wrong pragma marker. Just removing that pragma gives us back the same behaviour as in  Pharo 3/4. :D


I know that the exception handling/debugging has been modified several times in the latest years (some refactorings, hiding contexts...), we unfortunately don't have tests for it, so I'd like some more pair of eyes on it. Ben, Martin could you take a look?

Thanks all for the fish,
Guille



--
Reply | Threaded
Open this post in threaded view
|

Re: About the infinite debugger

Ben Coman
In reply to this post by Guillermo Polito


On 29 June 2018 at 22:48, Guillermo Polito <[hidden email]> wrote:
Hi all,

during today's sprint we have been working with lots of people on the infinite debugger problem (https://pharo.fogbugz.com/f/cases/22085/). We have checked the emails sent in the latest month. Then, together with Quentin, Pablo, Pavel, Yoan we have been discussing and testing hypothesis all day. We have been also comparing the debuggers code between pharo 3/4 (where the bug was is present) and pharo 7, but this was not necessarily straight forward as the code is not the same and there is no easy diff...

AAAAND, we have found that the problem may come from a wrong pragma marker. Just removing that pragma gives us back the same behaviour as in  Pharo 3/4. :D


I know that the exception handling/debugging has been modified several times in the latest years (some refactorings, hiding contexts...), we unfortunately don't have tests for it, so I'd like some more pair of eyes on it. Ben, Martin could you take a look?

Thanks all for the fish,
Guille

I'm just about to fly out for a family vacation, so I'm not sure when I'll get a chance to have a good look.
But I read the issue on Fogbugz and it echos some things I've been thinking recently,
though I hadn't come close to that particular fix.

I think my following comments are probably unrelated, but just sharing some thoughts that crossed my mind when I was looking into my own similar trouble.
This is an area I'm not clear on and would like to understand better...

When the UI thread (UI1) needs to be debugged (e.g. code run from Playground, or a test)
and is suspended and a new UI thread (UI2) is started, which thread does the debugger run in?
I guess it must run in UI2 but sometimes I got the vague feeling some parts of it were caught in UI1 and affected by UI1 being suspended.
But perhaps I got the wrong impression - its a complex interplay to follow.

The other vague notion I had was when thread UI1 is resumed, it seems to replace thread UI2 where the World keeps its, 
and wondered if <StepOver> on the suspended-debug-UI1 thread somehow made it "resume" and so replace UI2 as the main thread, 
but then UI1 gets suspended again and the display freezes.

Thanks for everyones efforts on this.
cheers -ben
Reply | Threaded
Open this post in threaded view
|

Re: [rmod] About the infinite debugger

Guillermo Polito
In reply to this post by Clément Béra


On Fri, Jun 29, 2018 at 5:54 PM Clément Bera <[hidden email]> wrote:
Hi,

Normally the pull request should break the exception tests, especially the ones with nested handler, since they are the reason 199 marked signalling contexts were introduced

Yes, but it's ok that on:do: is marked but why evaluateSignal:? Do you know?
 
.

Looking quickly this test in latest Pharo 7 for example:
ExceptionTests>>testHandlerContext
fails with the pull request.

Since the pull request changes a green test into a red test, I don't understand why you say "we unfortunately don't have tests for it".

Because I haven't see those. I was looking for tests about #findNextHandlerContext, #findNextHandlerOrSignalingContext and I found nothing.
But if we have some tests much better!
 
I don't understand either why you say this pragma is "wrong", so I can't help with that either.

Well, I don't know if I have to repeat myself... This is apparently provoking the infinite debugger issue. This pragma was not there in Pharo3, and its not clear why a method that is not an exception handler is marked as an exception handler. Is that clear enough?

For more info you can read the issue.
 

Best,

On Fri, Jun 29, 2018 at 4:48 PM, Guillermo Polito <[hidden email]> wrote:
Hi all,

during today's sprint we have been working with lots of people on the infinite debugger problem (https://pharo.fogbugz.com/f/cases/22085/). We have checked the emails sent in the latest month. Then, together with Quentin, Pablo, Pavel, Yoan we have been discussing and testing hypothesis all day. We have been also comparing the debuggers code between pharo 3/4 (where the bug was is present) and pharo 7, but this was not necessarily straight forward as the code is not the same and there is no easy diff...

AAAAND, we have found that the problem may come from a wrong pragma marker. Just removing that pragma gives us back the same behaviour as in  Pharo 3/4. :D


I know that the exception handling/debugging has been modified several times in the latest years (some refactorings, hiding contexts...), we unfortunately don't have tests for it, so I'd like some more pair of eyes on it. Ben, Martin could you take a look?

Thanks all for the fish,
Guille



--


--

   

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

Reply | Threaded
Open this post in threaded view
|

Re: About the infinite debugger

Guillermo Polito
In reply to this post by Ben Coman


On Fri, Jun 29, 2018 at 5:58 PM Ben Coman <[hidden email]> wrote:


On 29 June 2018 at 22:48, Guillermo Polito <[hidden email]> wrote:
Hi all,

during today's sprint we have been working with lots of people on the infinite debugger problem (https://pharo.fogbugz.com/f/cases/22085/). We have checked the emails sent in the latest month. Then, together with Quentin, Pablo, Pavel, Yoan we have been discussing and testing hypothesis all day. We have been also comparing the debuggers code between pharo 3/4 (where the bug was is present) and pharo 7, but this was not necessarily straight forward as the code is not the same and there is no easy diff...

AAAAND, we have found that the problem may come from a wrong pragma marker. Just removing that pragma gives us back the same behaviour as in  Pharo 3/4. :D


I know that the exception handling/debugging has been modified several times in the latest years (some refactorings, hiding contexts...), we unfortunately don't have tests for it, so I'd like some more pair of eyes on it. Ben, Martin could you take a look?

Thanks all for the fish,
Guille

I'm just about to fly out for a family vacation, so I'm not sure when I'll get a chance to have a good look.
But I read the issue on Fogbugz and it echos some things I've been thinking recently,
though I hadn't come close to that particular fix.

I think my following comments are probably unrelated, but just sharing some thoughts that crossed my mind when I was looking into my own similar trouble.
This is an area I'm not clear on and would like to understand better...

When the UI thread (UI1) needs to be debugged (e.g. code run from Playground, or a test)
and is suspended and a new UI thread (UI2) is started, which thread does the debugger run in?

Yes
 
I guess it must run in UI2 but sometimes I got the vague feeling some parts of it were caught in UI1 and affected by UI1 being suspended. 
But perhaps I got the wrong impression - its a complex interplay to follow.

Nope.. Actually, UI2 will simulate code of UI1 as it was running in UI1. There is some machinery (look at #effectiveProcess) so that 

Processor activeProcess

yields UI1 when stepping over UI2 code.
 

The other vague notion I had was when thread UI1 is resumed, it seems to replace thread UI2 where the World keeps its, 
and wondered if <StepOver> on the suspended-debug-UI1 thread somehow made it "resume" and so replace UI2 as the main thread, 
but then UI1 gets suspended again and the display freezes.

Thanks for everyones efforts on this.
cheers -ben


--

   

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

Reply | Threaded
Open this post in threaded view
|

Re: About the infinite debugger

Esteban A. Maringolo
In reply to this post by Guillermo Polito
Great news!

I hope this fixes it once and for all.

For some reason this bug bit me several times in several Pharo releases.

Thank you all for your dedication.

On 29/06/2018 11:48, Guillermo Polito wrote:

> Hi all,
>
> during today's sprint we have been working with lots of people on the
> infinite debugger problem (https://pharo.fogbugz.com/f/cases/22085/). We
> have checked the emails sent in the latest month. Then, together with
> Quentin, Pablo, Pavel, Yoan we have been discussing and testing
> hypothesis all day. We have been also comparing the debuggers code
> between pharo 3/4 (where the bug was is present) and pharo 7, but this
> was not necessarily straight forward as the code is not the same and
> there is no easy diff...
>
> AAAAND, we have found that the problem may come from a wrong pragma
> marker. Just removing that pragma gives us back the same behaviour as
> in  Pharo 3/4. :D
>
> https://github.com/pharo-project/pharo/pull/1621
>
> I know that the exception handling/debugging has been modified several
> times in the latest years (some refactorings, hiding contexts...), we
> unfortunately don't have tests for it, so I'd like some more pair of
> eyes on it. Ben, Martin could you take a look?
>
> Thanks all for the fish,
> Guille

--
Esteban A. Maringolo

Reply | Threaded
Open this post in threaded view
|

Re: About the infinite debugger

Eliot Miranda-2
In reply to this post by Guillermo Polito
Hi Guille,

On Jun 29, 2018, at 7:48 AM, Guillermo Polito <[hidden email]> wrote:

Hi all,

during today's sprint we have been working with lots of people on the infinite debugger problem (https://pharo.fogbugz.com/f/cases/22085/). We have checked the emails sent in the latest month. Then, together with Quentin, Pablo, Pavel, Yoan we have been discussing and testing hypothesis all day. We have been also comparing the debuggers code between pharo 3/4 (where the bug was is present) and pharo 7, but this was not necessarily straight forward as the code is not the same and there is no easy diff...

This is frustrating.  I can’t see the issue cuz I can’t login to fogbugz.  Having to login to read an issue is a major flaw.  I can see it makes sense for submitting, but fir merely browsing it should be unacceptable.  That said...

The pragma <primitive: 199> actually sets the primitive number in the method, so it it not merely a pragma; it alters bits in the method that the VM uses to search for handler contexts.  So why one would do that for evaluateSignal: makes no sense to me. The primitive should be set only in on:do: or something very similar (for example one could imagine adding on:or:do: instead of using , to construct an ExceptionSet).  So I think removing it from evaluateSignal: is definitely the right thing to do.

As far as tests for findNextHandlerFrom:, this is tested implicitly by any nested exception test so I expect you have several tests affected.  Clément points to a test that fails when not including <primitive: 199> in evaluateSignal: so more investigation is necessary.  Difficult to do while bugs are hidden in fogbugz.  When are they going to migrate the github where they belong?


AAAAND, we have found that the problem may come from a wrong pragma marker. Just removing that pragma gives us back the same behaviour as in  Pharo 3/4. :D


I know that the exception handling/debugging has been modified several times in the latest years (some refactorings, hiding contexts...), we unfortunately don't have tests for it, so I'd like some more pair of eyes on it. Ben, Martin could you take a look?

Thanks all for the fish,
Guille
Reply | Threaded
Open this post in threaded view
|

Re: About the infinite debugger

Marcus Denker-4


On 30 Jun 2018, at 02:56, Eliot Miranda <[hidden email]> wrote:

Hi Guille,

On Jun 29, 2018, at 7:48 AM, Guillermo Polito <[hidden email]> wrote:

Hi all,

during today's sprint we have been working with lots of people on the infinite debugger problem (https://pharo.fogbugz.com/f/cases/22085/). We have checked the emails sent in the latest month. Then, together with Quentin, Pablo, Pavel, Yoan we have been discussing and testing hypothesis all day. We have been also comparing the debuggers code between pharo 3/4 (where the bug was is present) and pharo 7, but this was not necessarily straight forward as the code is not the same and there is no easy diff...

This is frustrating.  I can’t see the issue cuz I can’t login to fogbugz.  Having to login to read an issue is a major flaw.  I can see it makes sense for submitting, but fir merely browsing it should be unacceptable.  That said...

The pragma <primitive: 199> actually sets the primitive number in the method, so it it not merely a pragma; it alters bits in the method that the VM uses to search for handler contexts.  So why one would do that for evaluateSignal: makes no sense to me. The primitive should be set only in on:do: or something very similar (for example one could imagine adding on:or:do: instead of using , to construct an ExceptionSet).  So I think removing it from evaluateSignal: is definitely the right thing to do.

As far as tests for findNextHandlerFrom:, this is tested implicitly by any nested exception test so I expect you have several tests affected.  Clément points to a test that fails when not including <primitive: 199> in evaluateSignal: so more investigation is necessary.  Difficult to do while bugs are hidden in fogbugz.  When are they going to migrate the github where they belong?

Yes, the idea was to move the issue tracker to GitHub… but after the release is done (as it requires changing again some things).
The closed-ness of fugbugz is really annoying.

Marcus

Reply | Threaded
Open this post in threaded view
|

Re: About the infinite debugger

Martin McClure-2
In reply to this post by Guillermo Polito
On 06/29/2018 07:48 AM, Guillermo Polito wrote:

> Hi all,
>
> during today's sprint we have been working with lots of people on the
> infinite debugger problem (https://pharo.fogbugz.com/f/cases/22085/).
> We have checked the emails sent in the latest month. Then, together
> with Quentin, Pablo, Pavel, Yoan we have been discussing and testing
> hypothesis all day. We have been also comparing the debuggers code
> between pharo 3/4 (where the bug was is present) and pharo 7, but this
> was not necessarily straight forward as the code is not the same and
> there is no easy diff...
>
> AAAAND, we have found that the problem may come from a wrong pragma
> marker. Just removing that pragma gives us back the same behaviour as
> in  Pharo 3/4. :D
>
> https://github.com/pharo-project/pharo/pull/1621
>
> I know that the exception handling/debugging has been modified several
> times in the latest years (some refactorings, hiding contexts...), we
> unfortunately don't have tests for it, so I'd like some more pair of
> eyes on it. Ben, Martin could you take a look?
>

Hi Guille,
I'm just back from vacation last week, and about to go on vacation for
another week, but I'll see what I can see.
About the primitive pragmas for context-marking, I think some of those
were changed for the exception handling fix that Andres and I did a few
years back, so *could* be involved in this. I'd hate to see regression
in the exception handling in an attempt to fix this bug.

Regards,
-Martin

Reply | Threaded
Open this post in threaded view
|

Re: About the infinite debugger

Martin McClure-2
On 07/03/2018 05:02 PM, Martin McClure wrote:

> On 06/29/2018 07:48 AM, Guillermo Polito wrote:
>> I know that the exception handling/debugging has been modified several
>> times in the latest years (some refactorings, hiding contexts...), we
>> unfortunately don't have tests for it, so I'd like some more pair of
>> eyes on it. Ben, Martin could you take a look?
>>
> Hi Guille,
> I'm just back from vacation last week, and about to go on vacation for
> another week, but I'll see what I can see.
> About the primitive pragmas for context-marking, I think some of those
> were changed for the exception handling fix that Andres and I did a few
> years back, so *could* be involved in this. I'd hate to see regression
> in the exception handling in an attempt to fix this bug.
>

After a look at at the pull request, I'm quite sure that removing the
prim 199 marker is the wrong thing to do. Thanks, Pablo, for restoring
it! The start of execution of exception handlers must be marked in order
for #findNextHandlerContext to work correctly. If these contexts are not
marked, exceptions signaled from inside an exception handler can find
the wrong handler. See the code and comment in #findNextHandlerContext.

I'm afraid that I cannot immediately help with the debugger problem,
since I don't know the debugger nearly as well as I do the exception
handling code, and I'm going on vacation for a week in 20 minutes. :-)
Perhaps when I get back I can take a look at it if it is still a problem
by then.

Regards,
-Martin

Reply | Threaded
Open this post in threaded view
|

Re: About the infinite debugger

NorbertHartl
bump

> Am 04.07.2018 um 02:28 schrieb Martin McClure <[hidden email]>:
>
>> On 07/03/2018 05:02 PM, Martin McClure wrote:
>>> On 06/29/2018 07:48 AM, Guillermo Polito wrote:
>>> I know that the exception handling/debugging has been modified several
>>> times in the latest years (some refactorings, hiding contexts...), we
>>> unfortunately don't have tests for it, so I'd like some more pair of
>>> eyes on it. Ben, Martin could you take a look?
>>>
>> Hi Guille,
>> I'm just back from vacation last week, and about to go on vacation for
>> another week, but I'll see what I can see.
>> About the primitive pragmas for context-marking, I think some of those
>> were changed for the exception handling fix that Andres and I did a few
>> years back, so *could* be involved in this. I'd hate to see regression
>> in the exception handling in an attempt to fix this bug.
>>
>
> After a look at at the pull request, I'm quite sure that removing the
> prim 199 marker is the wrong thing to do. Thanks, Pablo, for restoring
> it! The start of execution of exception handlers must be marked in order
> for #findNextHandlerContext to work correctly. If these contexts are not
> marked, exceptions signaled from inside an exception handler can find
> the wrong handler. See the code and comment in #findNextHandlerContext.
>
> I'm afraid that I cannot immediately help with the debugger problem,
> since I don't know the debugger nearly as well as I do the exception
> handling code, and I'm going on vacation for a week in 20 minutes. :-)
> Perhaps when I get back I can take a look at it if it is still a problem
> by then.
>
> Regards,
> -Martin
>

Reply | Threaded
Open this post in threaded view
|

Re: About the infinite debugger

Tim Mackinnon
Guys - this really needs attention - I’ve spend hours now trying to debug some code and most of it is in closing infinite debuggers. It makes a mockery of our tagline - “awesome debugging”. And the extra irony is that I’m debugging some file path stuff for exercism, to make it easier for hopefully more people to learn Pharo.

How can we get this fixed?

Tim

> On 2 Aug 2018, at 21:44, Norbert Hartl <[hidden email]> wrote:
>
> bump
>
>> Am 04.07.2018 um 02:28 schrieb Martin McClure <[hidden email]>:
>>
>>> On 07/03/2018 05:02 PM, Martin McClure wrote:
>>>> On 06/29/2018 07:48 AM, Guillermo Polito wrote:
>>>> I know that the exception handling/debugging has been modified several
>>>> times in the latest years (some refactorings, hiding contexts...), we
>>>> unfortunately don't have tests for it, so I'd like some more pair of
>>>> eyes on it. Ben, Martin could you take a look?
>>>>
>>> Hi Guille,
>>> I'm just back from vacation last week, and about to go on vacation for
>>> another week, but I'll see what I can see.
>>> About the primitive pragmas for context-marking, I think some of those
>>> were changed for the exception handling fix that Andres and I did a few
>>> years back, so *could* be involved in this. I'd hate to see regression
>>> in the exception handling in an attempt to fix this bug.
>>>
>>
>> After a look at at the pull request, I'm quite sure that removing the
>> prim 199 marker is the wrong thing to do. Thanks, Pablo, for restoring
>> it! The start of execution of exception handlers must be marked in order
>> for #findNextHandlerContext to work correctly. If these contexts are not
>> marked, exceptions signaled from inside an exception handler can find
>> the wrong handler. See the code and comment in #findNextHandlerContext.
>>
>> I'm afraid that I cannot immediately help with the debugger problem,
>> since I don't know the debugger nearly as well as I do the exception
>> handling code, and I'm going on vacation for a week in 20 minutes. :-)
>> Perhaps when I get back I can take a look at it if it is still a problem
>> by then.
>>
>> Regards,
>> -Martin
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: About the infinite debugger

Steven Costiou-2

Hi,

i had no answer to my comments on fogbuz (one of the first) so i assumed it was not a good idea.

In the usecases i used to reproduce the bug, replacing "ex pass" by "ex debug" in runCaseForDebug:solved the problem. See the analysis on fogbuz.

Did not have any side effect, but i do not know enough about the system and maybe it does. I think i already asked about that somewhere (here or on discord) but no answers.

But maybe it is wrong to do that? I'd be happy to have feedback on that.

Steven.

Le 2018-08-05 22:27, Tim Mackinnon a écrit :

Guys - this really needs attention - I've spend hours now trying to debug some code and most of it is in closing infinite debuggers. It makes a mockery of our tagline - "awesome debugging". And the extra irony is that I'm debugging some file path stuff for exercism, to make it easier for hopefully more people to learn Pharo.

How can we get this fixed?

Tim

On 2 Aug 2018, at 21:44, Norbert Hartl <[hidden email]> wrote:

bump

Am 04.07.2018 um 02:28 schrieb Martin McClure <[hidden email]>:

On 07/03/2018 05:02 PM, Martin McClure wrote:
On 06/29/2018 07:48 AM, Guillermo Polito wrote:
I know that the exception handling/debugging has been modified several
times in the latest years (some refactorings, hiding contexts...), we
unfortunately don't have tests for it, so I'd like some more pair of
eyes on it. Ben, Martin could you take a look?
Hi Guille,
I'm just back from vacation last week, and about to go on vacation for
another week, but I'll see what I can see.
About the primitive pragmas for context-marking, I think some of those
were changed for the exception handling fix that Andres and I did a few
years back, so *could* be involved in this. I'd hate to see regression
in the exception handling in an attempt to fix this bug.

After a look at at the pull request, I'm quite sure that removing the
prim 199 marker is the wrong thing to do. Thanks, Pablo, for restoring
it! The start of execution of exception handlers must be marked in order
for #findNextHandlerContext to work correctly. If these contexts are not
marked, exceptions signaled from inside an exception handler can find
the wrong handler. See the code and comment in #findNextHandlerContext.

I'm afraid that I cannot immediately help with the debugger problem,
since I don't know the debugger nearly as well as I do the exception
handling code, and I'm going on vacation for a week in 20 minutes. :-)
Perhaps when I get back I can take a look at it if it is still a problem
by then.

Regards,
-Martin

 

Reply | Threaded
Open this post in threaded view
|

Re: About the infinite debugger

Esteban A. Maringolo
In reply to this post by Tim Mackinnon


El dom., 5 de ago. de 2018 17:28, Tim Mackinnon <[hidden email]> escribió:
Guys - this really needs attention - I’ve spend hours now trying to debug some code and most of it is in closing infinite debuggers. It makes a mockery of our tagline - “awesome debugging”.

We can change the tagline to "limitless debugging".
Reply | Threaded
Open this post in threaded view
|

Re: [rmod] About the infinite debugger

Stéphane Ducasse
In reply to this post by Tim Mackinnon
Hi tim

We know and we made huge progress because before we could not even reproduce it. 
We spent some times on it. I thought the solution found by pablo and santiago got integrated.

Stef

Guys - this really needs attention - I’ve spend hours now trying to debug some code and most of it is in closing infinite debuggers. It makes a mockery of our tagline - “awesome debugging”. And the extra irony is that I’m debugging some file path stuff for exercism, to make it easier for hopefully more people to learn Pharo.

How can we get this fixed?

Tim

On 2 Aug 2018, at 21:44, Norbert Hartl <[hidden email]> wrote:

bump

Am 04.07.2018 um 02:28 schrieb Martin McClure <[hidden email]>:

On 07/03/2018 05:02 PM, Martin McClure wrote:
On 06/29/2018 07:48 AM, Guillermo Polito wrote:
I know that the exception handling/debugging has been modified several
times in the latest years (some refactorings, hiding contexts...), we
unfortunately don't have tests for it, so I'd like some more pair of
eyes on it. Ben, Martin could you take a look?

Hi Guille,
I'm just back from vacation last week, and about to go on vacation for
another week, but I'll see what I can see.
About the primitive pragmas for context-marking, I think some of those
were changed for the exception handling fix that Andres and I did a few
years back, so *could* be involved in this. I'd hate to see regression
in the exception handling in an attempt to fix this bug.


After a look at at the pull request, I'm quite sure that removing the
prim 199 marker is the wrong thing to do. Thanks, Pablo, for restoring
it! The start of execution of exception handlers must be marked in order
for #findNextHandlerContext to work correctly. If these contexts are not
marked, exceptions signaled from inside an exception handler can find
the wrong handler. See the code and comment in #findNextHandlerContext.

I'm afraid that I cannot immediately help with the debugger problem,
since I don't know the debugger nearly as well as I do the exception
handling code, and I'm going on vacation for a week in 20 minutes. :-)
Perhaps when I get back I can take a look at it if it is still a problem
by then.

Regards,
-Martin




--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Julie Jonas 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France

Reply | Threaded
Open this post in threaded view
|

Re: [rmod] About the infinite debugger

Guillermo Polito
Hi Tim,

Are you on Pharo 6 or 7? If in 7, what build are you using?

Pablo and Santi have made a fix 2 fridays ago (that I presume got integrated last week). The fix consists on changing a bit the exception handling during exception handling.


The fix seems simple, but it has a lot of information contained on it (like the fact that the system introduces exception handlers in the middle of the stack transparently to manage errors while stepping, or the fact that UnhandledError does another traversal of the stack but needs to start at the good place...). The Exception tests we had are still green, and we can now do stepping on code that raises exceptions. When stepping inside the DNU multiple times the debugging experience is not as smooth as the one in Pharo 3 (before it got broken) but this is FAR BETTER than Pharo7 since we have not experienced new infinite debuggers anymore :)...

I'll let Pablo and Santi answer more properly with the technical details.

On my side, I think we need to better document and do some more unit tests on that dark part of the system :).

On Mon, Aug 6, 2018 at 8:50 AM Stéphane Ducasse <[hidden email]> wrote:
Hi tim

We know and we made huge progress because before we could not even reproduce it. 
We spent some times on it. I thought the solution found by pablo and santiago got integrated.

Stef

Guys - this really needs attention - I’ve spend hours now trying to debug some code and most of it is in closing infinite debuggers. It makes a mockery of our tagline - “awesome debugging”. And the extra irony is that I’m debugging some file path stuff for exercism, to make it easier for hopefully more people to learn Pharo.

How can we get this fixed?

Tim

On 2 Aug 2018, at 21:44, Norbert Hartl <[hidden email]> wrote:

bump

Am 04.07.2018 um 02:28 schrieb Martin McClure <[hidden email]>:

On 07/03/2018 05:02 PM, Martin McClure wrote:
On 06/29/2018 07:48 AM, Guillermo Polito wrote:
I know that the exception handling/debugging has been modified several
times in the latest years (some refactorings, hiding contexts...), we
unfortunately don't have tests for it, so I'd like some more pair of
eyes on it. Ben, Martin could you take a look?

Hi Guille,
I'm just back from vacation last week, and about to go on vacation for
another week, but I'll see what I can see.
About the primitive pragmas for context-marking, I think some of those
were changed for the exception handling fix that Andres and I did a few
years back, so *could* be involved in this. I'd hate to see regression
in the exception handling in an attempt to fix this bug.


After a look at at the pull request, I'm quite sure that removing the
prim 199 marker is the wrong thing to do. Thanks, Pablo, for restoring
it! The start of execution of exception handlers must be marked in order
for #findNextHandlerContext to work correctly. If these contexts are not
marked, exceptions signaled from inside an exception handler can find
the wrong handler. See the code and comment in #findNextHandlerContext.

I'm afraid that I cannot immediately help with the debugger problem,
since I don't know the debugger nearly as well as I do the exception
handling code, and I'm going on vacation for a week in 20 minutes. :-)
Perhaps when I get back I can take a look at it if it is still a problem
by then.

Regards,
-Martin




--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Julie Jonas 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France



--

   

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

Reply | Threaded
Open this post in threaded view
|

Re: [rmod] About the infinite debugger

Tim Mackinnon
Hey thanks - this is Pharo 6.1, with a zero conf downloaded yesterday, and a second image from a week ago. I guess its possible that I don’t have those changes - is there an easy way to check? 

I’m happy to try applying them - or use a different image to test with - as it seems that certain conditions really rear their head and then you just get the problem over and over.

On the plus side - its rare that you crash you image and then have to recover changes - but its just annoying when it gets in the way of debugging. ITs not just all the windows, its also the fact that none of the debugger windows actually puts you in a useful stack where you can see the problem - they are all stuck on DNU with a single line stack.

Tim

On 6 Aug 2018, at 09:46, Guillermo Polito <[hidden email]> wrote:

Hi Tim,

Are you on Pharo 6 or 7? If in 7, what build are you using?

Pablo and Santi have made a fix 2 fridays ago (that I presume got integrated last week). The fix consists on changing a bit the exception handling during exception handling.


The fix seems simple, but it has a lot of information contained on it (like the fact that the system introduces exception handlers in the middle of the stack transparently to manage errors while stepping, or the fact that UnhandledError does another traversal of the stack but needs to start at the good place...). The Exception tests we had are still green, and we can now do stepping on code that raises exceptions. When stepping inside the DNU multiple times the debugging experience is not as smooth as the one in Pharo 3 (before it got broken) but this is FAR BETTER than Pharo7 since we have not experienced new infinite debuggers anymore :)...

I'll let Pablo and Santi answer more properly with the technical details.

On my side, I think we need to better document and do some more unit tests on that dark part of the system :).

On Mon, Aug 6, 2018 at 8:50 AM Stéphane Ducasse <[hidden email]> wrote:
Hi tim

We know and we made huge progress because before we could not even reproduce it. 
We spent some times on it. I thought the solution found by pablo and santiago got integrated.

Stef

Guys - this really needs attention - I’ve spend hours now trying to debug some code and most of it is in closing infinite debuggers. It makes a mockery of our tagline - “awesome debugging”. And the extra irony is that I’m debugging some file path stuff for exercism, to make it easier for hopefully more people to learn Pharo.

How can we get this fixed?

Tim

On 2 Aug 2018, at 21:44, Norbert Hartl <[hidden email]> wrote:

bump

Am 04.07.2018 um 02:28 schrieb Martin McClure <[hidden email]>:

On 07/03/2018 05:02 PM, Martin McClure wrote:
On 06/29/2018 07:48 AM, Guillermo Polito wrote:
I know that the exception handling/debugging has been modified several
times in the latest years (some refactorings, hiding contexts...), we
unfortunately don't have tests for it, so I'd like some more pair of
eyes on it. Ben, Martin could you take a look?

Hi Guille,
I'm just back from vacation last week, and about to go on vacation for
another week, but I'll see what I can see.
About the primitive pragmas for context-marking, I think some of those
were changed for the exception handling fix that Andres and I did a few
years back, so *could* be involved in this. I'd hate to see regression
in the exception handling in an attempt to fix this bug.


After a look at at the pull request, I'm quite sure that removing the
prim 199 marker is the wrong thing to do. Thanks, Pablo, for restoring
it! The start of execution of exception handlers must be marked in order
for #findNextHandlerContext to work correctly. If these contexts are not
marked, exceptions signaled from inside an exception handler can find
the wrong handler. See the code and comment in #findNextHandlerContext.

I'm afraid that I cannot immediately help with the debugger problem,
since I don't know the debugger nearly as well as I do the exception
handling code, and I'm going on vacation for a week in 20 minutes. :-)
Perhaps when I get back I can take a look at it if it is still a problem
by then.

Regards,
-Martin




--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Julie Jonas 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France



--
   
Guille Polito
Research Engineer


Centre de Recherche en Informatique, Signal et Automatique de Lille
CRIStAL - UMR 9189
French National Center for Scientific Research - http://www.cnrs.fr

Phone: +33 06 52 70 66 13

Reply | Threaded
Open this post in threaded view
|

Re: About the infinite debugger

Guillermo Polito
In reply to this post by Steven Costiou-2
Hi Steven,

The thing about your fix was mainly that it only worked for the case of running tests. We could however reproduce this bug from a playground too.

At first, replacing #pass to #debug looked like a hack to me :) Just looking at the code of  runCaseForDebug:, I felt the correct thing to do there was to use #pass (and let any potential caller handle the exception if he wants).
Otherwise, we should be able to understand:
 - can #pass be used? is it buggy?
 - does it work on any case or it should be avoided in some cases?
 - and how can we fix it (or at least document it?)?

But still, I think you were in the right direction too, because your fix shows a good intuition too: both #pass and #debug will do different things with the exception.
-  #pass will **resignal** it from the current context,
-  #debug will just open a debugger on it.

So that means that probably there was a problem when the exception was handled in a calling context.



On Mon, Aug 6, 2018 at 12:29 AM Steven Costiou <[hidden email]> wrote:

Hi,

i had no answer to my comments on fogbuz (one of the first) so i assumed it was not a good idea.

In the usecases i used to reproduce the bug, replacing "ex pass" by "ex debug" in runCaseForDebug:solved the problem. See the analysis on fogbuz.

Did not have any side effect, but i do not know enough about the system and maybe it does. I think i already asked about that somewhere (here or on discord) but no answers.

But maybe it is wrong to do that? I'd be happy to have feedback on that.

Steven.

Le 2018-08-05 22:27, Tim Mackinnon a écrit :

Guys - this really needs attention - I've spend hours now trying to debug some code and most of it is in closing infinite debuggers. It makes a mockery of our tagline - "awesome debugging". And the extra irony is that I'm debugging some file path stuff for exercism, to make it easier for hopefully more people to learn Pharo.

How can we get this fixed?

Tim

On 2 Aug 2018, at 21:44, Norbert Hartl <[hidden email]> wrote:

bump

Am 04.07.2018 um 02:28 schrieb Martin McClure <[hidden email]>:

On 07/03/2018 05:02 PM, Martin McClure wrote:
On 06/29/2018 07:48 AM, Guillermo Polito wrote:
I know that the exception handling/debugging has been modified several
times in the latest years (some refactorings, hiding contexts...), we
unfortunately don't have tests for it, so I'd like some more pair of
eyes on it. Ben, Martin could you take a look?
Hi Guille,
I'm just back from vacation last week, and about to go on vacation for
another week, but I'll see what I can see.
About the primitive pragmas for context-marking, I think some of those
were changed for the exception handling fix that Andres and I did a few
years back, so *could* be involved in this. I'd hate to see regression
in the exception handling in an attempt to fix this bug.

After a look at at the pull request, I'm quite sure that removing the
prim 199 marker is the wrong thing to do. Thanks, Pablo, for restoring
it! The start of execution of exception handlers must be marked in order
for #findNextHandlerContext to work correctly. If these contexts are not
marked, exceptions signaled from inside an exception handler can find
the wrong handler. See the code and comment in #findNextHandlerContext.

I'm afraid that I cannot immediately help with the debugger problem,
since I don't know the debugger nearly as well as I do the exception
handling code, and I'm going on vacation for a week in 20 minutes. :-)
Perhaps when I get back I can take a look at it if it is still a problem
by then.

Regards,
-Martin

 



--

   

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

Reply | Threaded
Open this post in threaded view
|

Re: [rmod] About the infinite debugger

Stéphane Ducasse
In reply to this post by Tim Mackinnon

On 6 Aug 2018, at 09:54, Tim Mackinnon <[hidden email]> wrote:

Hey thanks - this is Pharo 6.1, with a zero conf downloaded yesterday, and a second image from a week ago. I guess its possible that I don’t have those changes - is there an easy way to check? 

These changes are not in Pharo 6.1 but they should because this is terrible!
And a new version of the mooc is coming. 


I’m happy to try applying them - or use a different image to test with - as it seems that certain conditions really rear their head and then you just get the problem over and over.

On the plus side - its rare that you crash you image and then have to recover changes - but its just annoying when it gets in the way of debugging.

No it is SUPER SUPER ANNOYING. 

ITs not just all the windows, its also the fact that none of the debugger windows actually puts you in a useful stack where you can see the problem - they are all stuck on DNU with a single line stack.

Tim

On 6 Aug 2018, at 09:46, Guillermo Polito <[hidden email]> wrote:

Hi Tim,

Are you on Pharo 6 or 7? If in 7, what build are you using?

Pablo and Santi have made a fix 2 fridays ago (that I presume got integrated last week). The fix consists on changing a bit the exception handling during exception handling.


The fix seems simple, but it has a lot of information contained on it (like the fact that the system introduces exception handlers in the middle of the stack transparently to manage errors while stepping, or the fact that UnhandledError does another traversal of the stack but needs to start at the good place...). The Exception tests we had are still green, and we can now do stepping on code that raises exceptions. When stepping inside the DNU multiple times the debugging experience is not as smooth as the one in Pharo 3 (before it got broken) but this is FAR BETTER than Pharo7 since we have not experienced new infinite debuggers anymore :)...

I'll let Pablo and Santi answer more properly with the technical details.

On my side, I think we need to better document and do some more unit tests on that dark part of the system :).

On Mon, Aug 6, 2018 at 8:50 AM Stéphane Ducasse <[hidden email]> wrote:
Hi tim

We know and we made huge progress because before we could not even reproduce it. 
We spent some times on it. I thought the solution found by pablo and santiago got integrated.

Stef

Guys - this really needs attention - I’ve spend hours now trying to debug some code and most of it is in closing infinite debuggers. It makes a mockery of our tagline - “awesome debugging”. And the extra irony is that I’m debugging some file path stuff for exercism, to make it easier for hopefully more people to learn Pharo.

How can we get this fixed?

Tim

On 2 Aug 2018, at 21:44, Norbert Hartl <[hidden email]> wrote:

bump

Am 04.07.2018 um 02:28 schrieb Martin McClure <[hidden email]>:

On 07/03/2018 05:02 PM, Martin McClure wrote:
On 06/29/2018 07:48 AM, Guillermo Polito wrote:
I know that the exception handling/debugging has been modified several
times in the latest years (some refactorings, hiding contexts...), we
unfortunately don't have tests for it, so I'd like some more pair of
eyes on it. Ben, Martin could you take a look?

Hi Guille,
I'm just back from vacation last week, and about to go on vacation for
another week, but I'll see what I can see.
About the primitive pragmas for context-marking, I think some of those
were changed for the exception handling fix that Andres and I did a few
years back, so *could* be involved in this. I'd hate to see regression
in the exception handling in an attempt to fix this bug.


After a look at at the pull request, I'm quite sure that removing the
prim 199 marker is the wrong thing to do. Thanks, Pablo, for restoring
it! The start of execution of exception handlers must be marked in order
for #findNextHandlerContext to work correctly. If these contexts are not
marked, exceptions signaled from inside an exception handler can find
the wrong handler. See the code and comment in #findNextHandlerContext.

I'm afraid that I cannot immediately help with the debugger problem,
since I don't know the debugger nearly as well as I do the exception
handling code, and I'm going on vacation for a week in 20 minutes. :-)
Perhaps when I get back I can take a look at it if it is still a problem
by then.

Regards,
-Martin




--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Julie Jonas 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France



--
   
Guille Polito
Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille
CRIStAL - UMR 9189
French National Center for Scientific Research - http://www.cnrs.fr

Phone: +33 06 52 70 66 13


--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Julie Jonas 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France

Reply | Threaded
Open this post in threaded view
|

Re: [rmod] About the infinite debugger

Martin McClure-2
In reply to this post by Guillermo Polito
On 08/06/2018 12:46 AM, Guillermo Polito wrote:

> Pablo and Santi have made a fix 2 fridays ago (that I presume got
> integrated last week). The fix consists on changing a bit the
> exception handling during exception handling.
>
> https://github.com/pharo-project/pharo/pull/1621/files
>
> The fix seems simple, but it has a lot of information contained on it
> (like the fact that the system introduces exception handlers in the
> middle of the stack transparently to manage errors while stepping, or
> the fact that UnhandledError does another traversal of the stack but
> needs to start at the good place...). The Exception tests we had are
> still green, and we can now do stepping on code that raises
> exceptions. When stepping inside the DNU multiple times the debugging
> experience is not as smooth as the one in Pharo 3 (before it got
> broken) but this is FAR BETTER than Pharo7 since we have not
> experienced new infinite debuggers anymore :)...
>
Thanks for the update, Guille, and the pointer to the fix.

This fix smells a bit hacky, but... I don't know the internals of the
debugger. It might be the best way to handle it. And I'm glad it has
improved the behavior.

Since I *am* familiar with the changes to exception handling, and the
reasons behind those changes, I'd be happy to sit down at Camp Smalltalk
in Cagliari with you or whoever knows a bit about this problem, and see
whether it's possible to make a smoother fix.

Regards,

-Martin


12