public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/18728] New: GCJ generates inner class code that fails to verify.
@ 2004-11-29 20:43 gcc-java at esclat dot net
  2004-12-02 18:26 ` [Bug java/18728] GCJ allows creation of inner class without qualifying reference tromey at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: gcc-java at esclat dot net @ 2004-11-29 20:43 UTC (permalink / raw)
  To: java-prs

Compiling the following code with gcj (at least with version 3.4.2 as shipped
with Fedora Core 3) reports no errors or warnings:

    class A { class B { int value; } }

    class VerifyBug {
        A.B b;

        VerifyBug() { b = new A.B(); }
        static void main(String args[]) {
            VerifyBug v = new VerifyBug();
        }
    }

However when attempting to run the resulting class files with either libgcj or
the Sun JDK 1.5.0 a java.lang.VerifyError is thrown.

Below is the output from a gij invocation:

Exception in thread "main" java.lang.VerifyError: verification failed at PC 10
in VerifyBug:<init>(()V): incompatible type on stack
   at _Jv_BytecodeVerifier.verify_fail(byte, int) (/usr/lib/libgcj.so.5.0.0)
   at _Jv_BytecodeVerifier.pop_init_ref(_Jv_BytecodeVerifier.type)
(/usr/lib/libgcj.so.5.0.0)
   at _Jv_BytecodeVerifier.verify_instructions_0() (/usr/lib/libgcj.so.5.0.0)
   at _Jv_VerifyMethod(_Jv_InterpMethod) (/usr/lib/libgcj.so.5.0.0)
   at _Jv_PrepareClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
   at _Jv_WaitForState(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
   at java.lang.VMClassLoader.linkClass0(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
   at java.lang.VMClassLoader.resolveClass(java.lang.Class)
(/usr/lib/libgcj.so.5.0.0)
   at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
(/usr/lib/libgcj.so.5.0.0)
   at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
   at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
   at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)
   at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean)
(/usr/lib/libgcj.so.5.0.0)
   at __libc_start_main (/lib/tls/libc-2.3.3.so)

I believe the original Java code is actually wrong, as non-static inner classes
can't be instantiated without an instance of the enclosing class around for some
unfathomable reason.  But gcj compiles it without complaint.

(I appologize if this is a duplicate.  I searched the list of open and fixed
bugs for Java and didn't anything that seemed to be the same problem, but it
seems possible that the cause is something already in the bug database but not
obvious to me.)

-- 
           Summary: GCJ generates inner class code that fails to verify.
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc-java at esclat dot net
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18728


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-09 20:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-18728-9701@http.gcc.gnu.org/bugzilla/>
2007-01-09 20:49 ` [Bug java/18728] GCJ allows creation of inner class without qualifying reference tromey at gcc dot gnu dot org
2004-11-29 20:43 [Bug java/18728] New: GCJ generates inner class code that fails to verify gcc-java at esclat dot net
2004-12-02 18:26 ` [Bug java/18728] GCJ allows creation of inner class without qualifying reference tromey at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).