dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pnet-developers] Re: [DotGNU] Bug in Pnet


From: ktreichel
Subject: Re: [Pnet-developers] Re: [DotGNU] Bug in Pnet
Date: Tue, 31 Oct 2006 08:18:15 +0100

Hi,

the jsr/return is only part ot the problem. We need to know the number of 
levels where the catcher is and adjust the stack according to this number of 
levels. In your sample the catch block is in the first finalizer block so the 
level is 1.
If there were other try{} finalize{} blocks in this finalizer and the exception 
is thrown in one of the nested finalizers the level still has to be 1 because 
the catcher is in the first finalizer.

If we assume that the return addresses are just on top of the stack base of the 
current function (which should be because the stack should be empty on entry of 
a finalize block) we should record the number of levels in the ILException 
object and adjust the stack just before the ecxeption object is pushed on the 
stack and the catch block is executed.

Maybe i missed something, but that's what came to my mind after thinking more 
about the problem.

> -----Ursprüngliche Nachricht-----
> Von: Russell Stuart <address@hidden>
> Gesendet: 31.10.06 00:43:05
> An: address@hidden
> Betreff: Re: [Pnet-developers] Re: [DotGNU] Bug in Pnet


> On Tue, 2006-10-31 at 07:58 +1000, Russell Stuart wrote:
> > Fixes committed to CVS.
> 
> After thinking about it, the fix I doesn't really
> solve the problem.  It only goes 1/2 way.  The 
> demonstration code I posted now works, and I can
> now continue development without ilrun getting
> segmentation violations.
> 
> However, the stack record by the "throw" will be
> wrong.  I presume whoever is looking at the stack
> recorded by the exception will not be expecting 
> the jsr return address to be in there.  Currently
> two fixes come to mind.  I don't know the code
> well enough to say which is better.
> 
> 1.  Create a local for the finally, and store the
>     return address in there at the top of the finally
>     block.
> 
> 2.  Create a second version of the exceptHeight variable.
>     One version is the stack height at entry to the 
>     function - just as was done before, the other is 
>     adjusted by jsr - as is done now.   The first is 
>     used when the stack is recorded.  The second is
>     what throw truncates the stack to.
> 
> No.2 is probably easier for me to implement.  Any other
> suggestions?
> 
> _______________________________________________
> Pnet-developers mailing list
> address@hidden
> http://dotgnu.org/mailman/listinfo/pnet-developers


_______________________________________________________________________
Viren-Scan für Ihren PC! Jetzt für jeden. Sofort, online und kostenlos.
Gleich testen! http://www.pc-sicherheit.web.de/freescan/?mc=022222



reply via email to

[Prev in Thread] Current Thread [Next in Thread]