Java binding libopenbabel_java.dylib - crashes the JVM using simple test OBabel.
Crashes verified for following environments:
OpenBabel Source:
2.3.1 source
2.3.2 source
Latest from Github (Feb 24th)
Host OS: MAC OS X 10.9.5
Java: 1.7.0_40, 1.8.0_66 and 1.8.0_74
Build process with make outputs are in attachments and include CMakeCache.txt are from the Latest OpenBabel source from github and the Java 1.8.0_74 environment. (Note other build combinations had same problem but figured latest code was best bet for figuring out this issue).
cmake -DEIGEN3_INCLUDE_DIR=/Users/marko/ob/eigen3.2.8 -DRUN_SWIG=ON -DJAVA_BINDINGS=ON -DCMAKE_INSTALL_PREFIX=/Users/marko/ob/vlatest/install ../ob-src 2>&1 | tee cmake.out
make | tee make.out
make install | tee make_install.out
make test | tee make_test.out
The make activities (cmake, make, make install, make test) all run successfully.
I had to convert "#"'s to "//" comments in open-babel-java.i since the 3.0.8 Swig I have in my environment treats them as directives.
The libopenbabel_java.jnilib is found and being loaded but crashes the JVM. The following is the JVM crash to the console:
# # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00000001363187a5, pid=17284, tid=6403 # # JRE version: Java(TM) SE Runtime Environment (8.0_74-b02) (build 1.8.0_74-b02) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.74-b02 interpreted mode bsd-amd64 compressed oops) # Problematic frame: # C [libawt_lwawt.dylib+0x447a5] JNI_OnLoad+0x91 # # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # An error report file with more information is saved as: # /Users/marko/eclipseLuna_ws/IZIntegOpenBabel_1_8_0_74/hs_err_pid17284.log # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. #
I get the same crash and location using 3 different Java VM's. The JVM installs and runtimes are solid and I verified that the the JVM's libs were picked up for each OpenBabel build. I have verified each JVM does work with other JNI libraries I have written.
I tried using the standard JVM flags: -verbose:jni and the Oracle specific JVM flags: -Xcheck:jni and -Xint (ie. don't use HotSpot) but got same results and didn't see any obvious issues logged before the crash.
The attached pidXXX.log has details about the crash.
I have done a full JVM core dump for these crashes but analysis so far has not helped since the JVM is dying early in the native lib loading.