Possible bytecode verifier issues

Andrew Haley aph@redhat.com
Fri Feb 28 15:20:00 GMT 2003


Ranjit Mathew writes:
 > > Ranjit Mathew writes:
 > >  > A MinGW GCJ user seems to be running into bytecode
 > >  > verification problems with GCJ 3.2 and now GCJ 3.3:
 > >  >
 > >  >
 > http://sourceforge.net/tracker/index.php?func=detail&aid=693547&group_id=2435&atid=102435
 > >  >
 > >  > With 3.2, he used to get lots of "bad pc in
 > >  > exception_table" errors which disappeared with 3.3,
 > >  > but now he gets "warning: exception handler inside
 > >  > code that is being protected" warnings.
 > >  >
 > >  > Is this is a known issue with GCJ or could it be
 > >  > that his class bytecodes are really SNAFU-ed?
 > >
 > > I have worked on this code.  gcj is almost certainly correct about
 > > this.
 > 
 > Quite likely. The original submitter ("djobet" on SF) notes that,
 > as suggested by Tom, when he recompiled with JDK 1.3, the
 > problem disappeared.
 > 
 > So it's likely a bug with the JDK 1.4 compiler.

I don't think it's a bug.  The bytecode is perfectly legal, if rather
odd.  However, we still generate a warning although we compile the
code correctly.

 > Note that at least according to the following document:
 > 
 >     http://java.sun.com/sfaq/verifier.html
 > 
 > (section "Exception Handlers") even if the bytecode fails these
 > conditions the verifier would not complain about it.
 > 
 > Not that I'm suggesting we do the same - IMHO it's good to
 > know that one has crappy bytecode on hand. :-)

We discussed this on the list six months or so ago.  It seemed to us
that although such bytecode is correct, it is so absurd that we should
complain about it.

Perhaps it is time to re-visit that decision.

Andrew.



More information about the Java mailing list