[Cuis-dev] On the changes to detect method returns in exception handlers

Juan Vuletich juan at jvuletich.org
Wed Oct 16 15:18:30 PDT 2019


Hi Phil,

Today I tried to understand the problems you ran into. The attachments 
are the result of this. To try this, Start Cuis without the recent 
changes (i.e. #3866), then load OMeta2Tests.pck.st. Now load 
OMetaStuff*.cs.st and UnsavedChangesTo-OMeta2Extensions*.cs.st attached 
here. Your tests now pass, and performance seems as usual. I suggest 
updating your repo with this.

My changes do two things. One is to avoid non local returns in handler 
blocks. The other one is about a few places where you did [ :exception | 
exception signal ] as the signal handler. Exceptions can only be 
signaled once! I changed them to do [ :exception | exception pass ]. 
This was breaking the exception system if the recent changes were loaded.

Finally, I suggest adding yet another change set to Cuis that could 
break existing but wrong code: 3924*.cs.st attached throws an error if 
an exception is signaled twice.

Please review.
Thanks,

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich



On 10/15/2019 9:19 PM, Phil B wrote:
> Juan,
>
> It looks like 3923 still alters Exception behavior which may break 
> some existing code.  (granted, in rare situations)  I was working on 
> adding a #nonLocalReturn: method and nothing was working so I went 
> back to a clean 3923 image and immediately saw why.  To reproduce:
>
> 1) Download https://github.com/pbella/OMeta-Cuis
> 2) Open a fresh 3923 image
> 3) Be sure to CLOSE the Transcript window for performance reasons.  
> There will be a <cough> few warning messages emitted.  (~36k of them[1])
> 4) Open a file browser
> 5) Navigate to the repo directory and install OMeta2Tests.pck.st 
> <http://OMeta2Tests.pck.st>
> 6) Open a Browser window
> 7) Navigate to OMeta2>>char (browsing any OMeta method will probably 
> do it since, in order to do syntax highlighting for the browser, it 
> has to fire off an OMeta parser which in turn uses exception blocks 
> with non-local returns extensively)
>
> At this point your image should hang while working its way to OOM.  
> I'd venture that one or more of OMeta's assumptions about exceptions 
> are no longer valid.  OMeta is my problem to fix but I just wanted to 
> make you aware that even the 'quieter' code in 3923 can have both 
> performance and functional impact.
>
> [1] A attempted full rebuild of my dev image resulted in >2M messages 
> before I killed it and disabled the message.
>
> Thanks,
> Phil
>
> On Mon, Oct 14, 2019 at 8:41 AM Juan Vuletich via Cuis-dev 
> <cuis-dev at lists.cuis.st <mailto:cuis-dev at lists.cuis.st>> wrote:
>
>     Hi Folks,
>
>     As you have already seen in a separate thread, yesterday I pushed
>     changes to Exceptions. While the changes are valuable, especially
>     in the
>     discussion they have triggered, and in showing an opportunity to
>     improve
>     non-trivial parts of the system, I pushed them without required
>     previous
>     discussion, and a better analysis of the immediate negative
>     consequences
>     in code breakage. I made this mistake all by myself, in a rush to
>     try to
>     get the code out even if I didn't have the time to do it in a better
>     way. I apologize for this.
>
>     I also want to thank you all, especially Hernán, Phil, and Andrés,
>     for
>     the constructive attitude in which you engaged in the relevant
>     discussion on how to better deal with the issue, instead of
>     focusing on
>     the annoyance, I'm sure we'll be able to improve the system after
>     this
>     discussion.
>
>     To avoid code breakage while we work out what we collectively want
>     to do
>     with the method-returns-in-exception-handlers issue, I just pushed
>     update #3923 that allows them again, and just logs a note to the
>     Transcript. I did this instead of taking back all the changes because
>     they are not trivial, and they will be useful for trying different
>     approaches.
>
>     Thanks,
>
>     -- 
>     Juan Vuletich
>     www.cuis-smalltalk.org <http://www.cuis-smalltalk.org>
>     https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
>     https://github.com/jvuletich
>     https://www.linkedin.com/in/juan-vuletich-75611b3
>     @JuanVuletich
>
>     -- 
>     Cuis-dev mailing list
>     Cuis-dev at lists.cuis.st <mailto:Cuis-dev at lists.cuis.st>
>     https://lists.cuis.st/mailman/listinfo/cuis-dev
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191016/1476baea/attachment.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 3924-SignalExceptionsOnlyOnce-JuanVuletich-2019Oct16-18h52m-jmv.1.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191016/1476baea/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: OMetaStuff-JuanVuletich-2019Oct16-16h14m-jmv.1.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191016/1476baea/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: UnsavedChangesTo-OMeta2Extensions-jmv.2.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191016/1476baea/attachment-0002.ksh>


More information about the Cuis-dev mailing list