java/5794: gcj fails to verify .class file generated by Sun JDK 1.4 compiler

Eric Blake ebb9@email.byu.edu
Wed Sep 11 15:16:00 GMT 2002


> I don't get this.  First, the testcases in question don't have any
> synchronization, so I don't see the relevance.  Secondly. I find it
> hard to see how an exception handler that handles itself makes the
> code more robust and safe.

See Sun's bug 4414101 for an example of code that produces an
exception handler that targets itself when compiled with JDK 1.4.1 or
with jikes 1.16 or greater, and Sun's official reasoning why it is
necessary for the nested handler.  Nested handlers also occur in
try-finally and try-catch-finally blocks in code compiled by javac.

http://developer.java.sun.com/developer/bugParade/bugs/4414101.html

Sun's argument at the above link is that JLS 17.13 require the
compiler to guarantee that the monitor is exited exactly once. If an
asynchronous IllegalMonitorStateException occurs, Sun would rather
have the thread enter an infinite loop than improperly exit the monitor.

----
Eric Blake



More information about the Java-patches mailing list