hotjava

Parmelan, Edouard EP510777 at exchange.FRANCE.NCR.com
Tue Nov 17 07:38:27 PST 1998


Hi Godmar,

>  Edouard,
> 
>  Unfortunately, releasing static locks is only part of a more fundamental
> problem.   In other instances, the problem results in memory leaks and 
> state corruption.  Basically, if a function doesn't return because it
> throws an exception, the caller won't have a chance to clean up its local
> state (locks, memory, other data structures).
> Look at such functions as tidyVerifyMethod or functions that need to free
> memory before returning.
> 
> We discussed various solutions, and decided to go with old-fashioned
> error code propagation.  I have a simple error code based solution almost 
> done, and hope I'll be able to check it in soon.

Good idea, but what about a static initializer which throws an exception ?

The following ProcessClassTest class could help you
Segv Test:
  <clinit>() throws NullPointerException

First Test:
  <clinit>() try to initialize Segv which throws NullPointerException

Second Test:
  The super class don't exist

Third Test:
  <clinit>() try to initialize DontExist which don't exist

With your ``old-fashioned error code propagation'' you could simulate
the catch of the ClassNotFoundException.
  
How your old-fasioned error code propagation could catch the
NullPointerException ?
 
If the answer is ``Add a try/catch in your C code'' don't use
old-fashioned error code propagation and implements the ``try/catch''
for C functions :(

What about OutOfMemoryException, UnsatisfiedLinkError, and all
possible calls to throwException() in the VM methods...


The diff TranslateTest.diff use a pizza-0.39g bug: use a method in place
of a field for synchronized().  When you run this buggy class with kaffe,
the translator call getField() which don't found it and throw an exception,
so it translate Throwable.<clinit>(): Attempt to reenter verifier!


Comments ?
Edouard.
---
 <<ProcessClassTest.java>> 
 <<TranslateTest.diff>> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ProcessClassTest.java
Type: application/octet-stream
Size: 1640 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/19981117/b7fc0ad5/attachment-0012.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TranslateTest.diff
Type: application/octet-stream
Size: 459 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/19981117/b7fc0ad5/attachment-0013.obj 


More information about the kaffe mailing list