stack overflow interacts poorly with classloaders

Jason Baker kaffe@rufus.w3.org
12 Jun 2000 16:28:36 -0600


Timothy Stack <stack@cs.utah.edu> writes:

> > Just preload it once and for all and throw the same type in all threads, 
> > even those that run in a classloader context.  
> > This should be "close enough".
> 
> Kaffe already does this, the problem is when it tries to match this class
> to the one in the catch clause.  Specifically, line 603 in exception.c:
> 
>   eptr[i].catch_type = getClass(eptr[i].catch_idx, ptr->class, &info);
> 
> We're trying to get a class (StackOverflowError) referenced in the
> constant pool which hasn't necessarily been resolved yet.  Eventually, it
> gets to loadClass where it will ask the class loader to load the class,
> and then poof.  Preloading in this case means checking if a class
> references StackOverflowError or any of its ancestors and then having the
> class loader load them in, or we just treat them as "special classes" that
> magically resolve to system classes regardless of the class loader.

Shouldn't all catch types be loaded during verification?

Jason