BUG/REGRESSION while debugging Generator >> #nextPut:

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

Re: Tackling Context>>#runUntilErrorReturnFrom: (was: BUG/REGRESSION while debugging Generator >> #nextPut:)

Christoph Thiede
Hi all, hi Jaromir,

with regard to the bug mentioned in [1], I have updated the changeset from
above:  runUntilErrorOrReturnFrom.cs
<http://forum.world.st/file/t372205/runUntilErrorOrReturnFrom.cs>  

Basically, I inserted a send to #informDebuggerAboutContextSwitchTo: in the
loop body of Context >> #resume:through: as well.

I could not find any regressions from the previous changeset, but since this
is a very low-level method, any crash tests will be appreciated. I believe
that in the past a similar approach has crashed my image, but I could not
reproduce this any longer today ...

I am also - still :-) - very excited to hear your feedback and thoughts on
the general approach. In my message from above, I have highlighted two bold
questions, it would be great if some of our Kernel experts could find a few
minutes for them. Nicolas? Eliot? Jaromir? :-)

Best,
Christoph

[1]
http://forum.world.st/stepping-over-non-local-return-in-a-protected-block-td5128777.html



-----
Carpe Squeak!
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: Tackling Context>>#runUntilErrorReturnFrom: (was: BUG/REGRESSION while debugging Generator >> #nextPut:)

Christoph Thiede
Version 7 of the changeset fixes glitches reported by Jaromir in [1]:
runUntilErrorOrReturnFrom.cs
<http://forum.world.st/file/t372205/runUntilErrorOrReturnFrom.cs>  

Best,
Christoph

[1]
http://forum.world.st/stepping-over-non-local-return-in-a-protected-block-tp5128777p5129736.html



-----
Carpe Squeak!
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: Tackling Context>>#runUntilErrorReturnFrom: (was: BUG/REGRESSION while debugging Generator >> #nextPut:)

Christoph Thiede
Version 8 of the changeset reverts the change to #runUntilErrorOrReturnFrom: definitely. Thanks, Jaromir ...

Best,
Christoph

["runUntilErrorOrReturnFrom.8.cs"]


runUntilErrorOrReturnFrom.8.cs (5K) Download Attachment
Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: Tackling Context>>#runUntilErrorReturnFrom: (was: BUG/REGRESSION while debugging Generator >> #nextPut:)

Jaromir Matas
This post was updated on .
In reply to this post by Christoph Thiede
Hi Christoph,


Christoph Thiede wrote
> Hi all, hi Jaromir,
>
> with regard to the bug mentioned in [1], I have updated the changeset from
> above:  runUntilErrorOrReturnFrom.cs
> <http://forum.world.st/file/t372205/runUntilErrorOrReturnFrom.cs> 
>
> Basically, I inserted a send to #informDebuggerAboutContextSwitchTo: in
> the
> loop body of Context >> #resume:through: as well.
>
> I could not find any regressions from the previous changeset, but since
> this
> is a very low-level method, any crash tests will be appreciated. I believe
> that in the past a similar approach has crashed my image, but I could not
> reproduce this any longer today ...
>
> I am also - still :-) - very excited to hear your feedback and thoughts on
> the general approach. In my message from above, I have highlighted two
> bold
> questions, it would be great if some of our Kernel experts could find a
> few
> minutes for them. Nicolas? Eliot? Jaromir? :-)
>
> Best,
> Christoph
>
> [1]
> http://forum.world.st/stepping-over-non-local-return-in-a-protected-block-td5128777.html
>
>
>
> -----
> Carpe Squeak!
> --
> Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Unless I'm mistaken I believe the issue from [1] is just a bug described in
[2], not a general issue. The implementation simply forgot to consider the
inserted guard contexts and can be fixed fully (I hope) by amending
#resume:through: and #return:from: as proposed in [1]. In such case
including #resume:through: in your changeset is not necessary.

You're addressing here a fundamental problem stemming from manipulating
contexts by #jump, #swapSender (and who knows what else) breaking the linear
order of context chains. On one hand it's amazing you can catch and deal
with those situations, on the other hand there are "false positives", I mean
catching harmless jumps and stopping the debugger unexpectedly e.g. during
debugging regular #terminate using "well behaving" jumps :)

I'm wondering: would it be possible to somehow recognize "harmless" or "well
known" jumps so that the changeset can let them be and only interrupt
"unknown" patterns or those somehow recognized as dangerous?

This is a very interesting problem and I look forward to your further
discoveries :)

best regards,



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

[1] http://forum.world.st/stepping-over-non-local-return-in-a-protected-block-td5128777.html
[2] https://source.squeak.org/inbox/Kernel-nice.1407.diff
^[^ Jaromir
12