Bug 60309 - JNI_CreateJavaVM aborts with java.system.class.loader property set
Summary: JNI_CreateJavaVM aborts with java.system.class.loader property set
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcj (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-22 00:29 UTC by Mike Miller
Modified: 2016-09-30 22:52 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
example call to JNI_CreateJavaVM (264 bytes, text/x-csrc)
2014-02-22 00:29 UTC, Mike Miller
Details
GNU Octave system class loader (919 bytes, text/x-java)
2014-02-22 00:31 UTC, Mike Miller
Details
trivial java main program crashes with custom class loader (112 bytes, text/x-java)
2014-02-22 00:31 UTC, Mike Miller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Miller 2014-02-22 00:29:42 UTC
Created attachment 32194 [details]
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 ../../../libjava/prims.cc:1667
#6  0x00007ffff7bda946 in JNI_CreateJavaVM (vm=0x7fffffffdea0, penv=0x7fffffffde98, 
    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
Aborted
Comment 1 Mike Miller 2014-02-22 00:31:04 UTC
Created attachment 32195 [details]
GNU Octave system class loader
Comment 2 Mike Miller 2014-02-22 00:31:44 UTC
Created attachment 32196 [details]
trivial java main program crashes with custom class loader
Comment 3 Andrew Pinski 2016-09-30 22:52:38 UTC
Closing as won't fix as libgcj (and the java front-end) has been removed from the trunk.