[Bug libgcj/60309] New: JNI_CreateJavaVM aborts with java.system.class.loader property set

mtmiller at ieee dot org gcc-bugzilla@gcc.gnu.org
Sat Feb 22 00:29:00 GMT 2014


            Bug ID: 60309
           Summary: JNI_CreateJavaVM aborts with java.system.class.loader
                    property set
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcj
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mtmiller at ieee dot org

Created attachment 32194
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32194&action=edit
example call to JNI_CreateJavaVM

Initializing the VM from either a C program or running a trivial test program
with gij both abort when the java.system.class.loader property is given to
JNI_CreateJavaVM. I see an earlier bug report indicating that this did work at
some point. However, I consistently get an abort() with 4.8.2 or built from
current svn trunk.

Backtrace of the attached C program looks like this:

#0  0x00007ffff78631d5 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff7866388 in __GI_abort () at abort.c:90
#2  0x00007ffff5b90d30 in _Jv_Throw (value=0x7ffff7f939d8)
    at ../../../libjava/exception.cc:128
#3  0x00007ffff5bc6c85 in java::lang::Class::initializeClass (
    this=0x7ffff71544c0 <java::lang::ClassLoader::class$>)
    at ../../../libjava/java/lang/natClass.cc:814
#4  0x00007ffff5b86396 in _Jv_InitClass (klass=<optimized out>)
    at ../../../libjava/java/lang/Class.h:742
#5  _Jv_CreateJavaVM (vm_args=<optimized out>) at
#6  0x00007ffff7bda946 in JNI_CreateJavaVM (vm=0x7fffffffdea0,
    args=<optimized out>) at ../../../libjava/jni-libjvm.cc:54
#7  0x0000000000400755 in main ()

I'm also attaching the class loader from GNU Octave that works with OpenJDK,
and a trivial hello world program for completeness that also aborts when run
with the java.system.class.loader property set:

$ gij TestMain
Hello, world
$ gij -Djava.system.class.loader=OctClassLoader TestMain
Exception during runtime initialization

More information about the Java-prs mailing list