[BUG?] Strange behavior of exceptions and ensure:
Pennell, David
DPennell at quallaby.com
Thu May 18 01:01:04 UTC 2000
I have something that seems related.
I have a do-it that works fine with alt-D but when I run
it with the mouse menu, my VM crashes. Crash.dmp says:
---------------------------------------------------------
Wed May 17 20:54:42 2000
Current byte code: 96
Primitive index: 0
Stack dump follows:
32635208 [] in PVTest>getIntervalFromNodes:
---------------------------------------------------------
This is the first VM crash I've seen in a long time.
Where do I look next?
-david
> -----Original Message-----
> From: Nathanael Schärli [mailto:n.schaerli at gmx.net]
> Sent: Wednesday, May 17, 2000 8:40 PM
> To: squeak at cs.uiuc.edu
> Subject: [BUG?] Strange behavior of exceptions and ensure:
>
>
> Hi Squeakers
>
> Yesterday, I noticed a very strange behavior of the Squeak exception
> mechanism.
> The following example illustrates this (The code is also in
> the attached
> fileout).
>
> Create the new class StrangeExample and add the following methods:
>
> StrangeExample class>>methodA1
> Transcript cr.
> self methodB.
> Transcript show: 'Finished1 '.
>
> StrangeExample class>>methodB
> [self error: 'ErrorMsg ']
> on: Error do:
> [:ex |
> Transcript show: 'ErrorHandling '.
> ex return: 5].
> Transcript show: 'Finished2 '.
>
>
> Now it's getting interesting. Open a workspace and type the code:
>
> StrangeExample methodA
>
> Now select this code and use the shortcut cmd-d for 'do it'.
> As expected the Transcript output is:
> 'ErrorHandling Finished2 Finished1'
>
> Now select the code again and use the mouse to select 'do it' in the
> context menu. Surprisingly the output in the Transcript is now:
> 'ErrorHandling Finished2'
> (I got this result with a current 2.8a image. Surprisingly I got the
> correct result using a default 2.7 image. However, the second
> part of the example
> (described below) shows a strange behavior using either of
> these images and
> thus this seems not to be a simple update bug).
>
> Why is the result different? After some debugging, I saw that
> the problem
> is the method BlockContext>>ensure: resp.
> BlockContext>>valueUninterruptably. If 'do it' is called via
> the mouse, the whole code is executed inside an
> ensure:, but when it is called via shortcut the code is
> executed without a
> call of ensure:.
>
> To verify this, I wrote the following method:
>
> StrangeExample class>>methodA2
> Transcript cr.
> [self methodB]
> ensure: [Transcript show: 'Ensure1 '].
> Transcript show: 'Finished1 '
>
> As expected, the output on the Transcript is
> 'ErrorHandling Finished2', and this independent wheter I
> started it via
> mouse or shortcut and also independent of the image version.
>
> It seems to me that execution stops when an exception occurse
> inside an
> ensure: resp. valueUninteruptably.
>
> Although I'm (up to a certain extent) familiar with the
> BlockContext and
> Exception implementations, it would take me some time to look
> at it closely.
> Therefore my question to the community: Can you confirm this
> behavior? Is
> it a bug? If yes, does anyone have a fix?
>
> Thanks
>
> Nathanael
>
> --
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
> Nathanael Schaerli
> Ruettenenstrasse 41
> CH-4515 Oberdorf, Switzerland
> Phone: +41 32 622 89 03
> Fax: +41 32 621 78 50
> Email: n.schaerli at gmx.net
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
>
>
More information about the Squeak-dev
mailing list
|