List Info

Thread: Bug in Pnet




Bug in Pnet
user name
2006-10-30 15:13:22
Hi Russel,

looks like it's not really the exception height where the
problem is but the number of nested blocks called through
jsr where the catcher is.

So adjusting the frameheight on jsr/ret_jsr sounds
reasonable for me because it should do the same for other
blocks called through jsr too.

Cheers,

Klaus
> -----Ursprüngliche Nachricht-----
> Von: Russell Stuart <rstuartlubemobile.com.au>
> Gesendet: 30.10.06 10:41:48
> An: ktreichelweb.de
> CC: pnet-developersdotgnu.org
> Betreff: Re: [Pnet-developers] Re: [DotGNU] Bug in Pnet


> On Mon, 2006-10-30 at 18:57 +1000, Russell Stuart
wrote:
> > It has taken me this long to figure that out.  The
tricky
> > part is fixing it.  The first thing that comes to
mind
> > is getting jsr/ret_jsr to adjust the exception
frame 
> > height, but that is ugly because it assumes that
jsr is 
> > only used for finally.  I think that is true. 
Anyone
> > get a better idea?
> 
> Replying to myself ... that does look like a reasonable
> way to fix it.  Unfortunately there is another bug, and
> how to fix it is not so obvious.
> 
> VMCASE(COP_PREFIX_ENTER_TRY) sets
thread->exceptHeight.  
> The reason is described in comment above viz: 'It sets 
> the "base height" of the stack so that
<i>throw</i> 
> instructions know where to unwind the stack to when an 
> exception is thrown.'
> 
> Fine.  But nowhere is thread->exceptHeight is
restored
> when the try{} block exits.  So I expect that something
> like this:
> 
>   try {
>      // thread->exceptHeight = stoptop in
COP_PREFIX_ENTER_TRY
>      some code that alters the stack height;
>      try {
>        // thread->exceptHeight = stoptop in
COP_PREFIX_ENTER_TRY
>      }
>      catch (Exception e) {}
>      // thread->exceptHeight hasn't been restored at
this point
>      throw new Exception();
>   }
>   catch (Exception e) {
>     // e at this point contains an invalid stack.
>   }
> 
> My problem is as far as I can tell, there is no code
> executed when a try{}catch(){} block exits, so its
> not possible to fix the bug without introducing
> another CVM opcode that is executed at the end of
> a try{}catch(){} block.
> 
> I'll just fix the original problem for now.
> 
> 


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

_______________________________________________
Pnet-developers mailing list
Pnet-developersdotgnu.org
ht
tp://dotgnu.org/mailman/listinfo/pnet-developers
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )