[squeak-dev] Tackling Context>>#runUntilErrorReturnFrom: (was: BUG/REGRESSION while debugging Generator >> #nextPut:)

Jaromir Matas m at jaromir.net
Sat May 29 21:03:40 UTC 2021

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

More information about the Squeak-dev mailing list