InChI loading causes java VM crash

User 8d34d3a066

24-01-2011 15:07:39

Hi,


When searching for particular InChI strings we can cause the java VM to crash. I suspect it is when calling MolImporter.importMol as the same thing happens when using a simple script to generate images. We are running this on an RHEL 5 server.


Java info:


$ java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) 64-Bit Server VM (build 16.0-b13, mixed mode)


An example InChI that is causing the issue:


InChI=1S/C8H7N/c1-2-4-8-7(3-1)5-6-9-8/h1-6,9H


Here is some sample output from the error log:


Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  java.lang.ClassLoader$NativeLibrary.load(Ljava/lang/String;)V+0
j  java.lang.ClassLoader.loadLibrary0(Ljava/lang/Class;Ljava/io/File;)Z+300
j  java.lang.ClassLoader.loadLibrary(Ljava/lang/Class;Ljava/lang/String;Z)V+127
j  java.lang.Runtime.load0(Ljava/lang/Class;Ljava/lang/String;)V+57
j  java.lang.System.load(Ljava/lang/String;)V+7
j  chemaxon.marvin.io.formats.inchi.Inchi.install()V+188
j  chemaxon.marvin.io.formats.inchi.Inchi.<clinit>()V+29
v  ~StubRoutines::call_stub
j  chemaxon.marvin.io.formats.inchi.InchiImport.createAuxInfo(Ljava/lang/String;)Ljava/lang/String;+75
j  chemaxon.marvin.io.formats.inchi.InchiImport.readInput()Ljava/lang/String;+158
j  chemaxon.marvin.io.formats.inchi.InchiImport.readMol(Lchemaxon/struc/Molecule;)Z+1
j  chemaxon.marvin.io.MRecordImporter.readStructure(Lchemaxon/marvin/io/MRecord;Lchemaxon/marvin/io/MolImportModule;Lchemaxon/struc/Molecule;)V+2
j  chemaxon.marvin.io.MRecordImporter.readMol(Lchemaxon/marvin/io/MRecord;Lchemaxon/marvin/io/MolImportModule;Lchemaxon/struc/Molecule;Ljava/lang/String;)Lchemaxon/struc/Molecule;+110
j  chemaxon.marvin.io.MRecordImporter.readMol(Lchemaxon/marvin/io/MRecord;Lchemaxon/struc/Molecule;)Lchemaxon/struc/Molecule;+13
j  chemaxon.marvin.io.MRecordImporter.readMol0(Lchemaxon/struc/Molecule;)Lchemaxon/struc/Molecule;+49
j  chemaxon.marvin.io.MRecordImporter.readMol(Lchemaxon/struc/Molecule;)Lchemaxon/struc/Molecule;+75
j  chemaxon.formats.MolImporter.readMol(Lchemaxon/struc/Molecule;)Lchemaxon/struc/Molecule;+51
j  chemaxon.formats.MolImporter.read(Lchemaxon/formats/MolImporter;)Lchemaxon/struc/Molecule;+7
j  chemaxon.formats.MolImporter.importMol([BLjava/lang/String;Ljava/lang/String;)Lchemaxon/struc/Molecule;+46
j  chemaxon.formats.MolImporter.importMol(Ljava/lang/String;)Lchemaxon/struc/Molecule;+14


Looks like an issue with the JNI interacting with native InChI code. If there is any more information I can provide please ask.


thanks


RIchard

ChemAxon 9c0afc9aaf

24-01-2011 15:25:03

Hi,


I have moved your question to the relevant forum section.


My colleagues will respond here soon.


Best,


Szilard

ChemAxon 0a9e2a55e1

25-01-2011 10:04:35

Dear Richard,


Yes, it seems that java can not find, or can not load the c dynamic library. On our Linux machines inchi works, and even if I delete the libraries, it only gives an exception not a VM crash...


I know about two problems, that may cause VM crash:


1) Which Marvin version do You use? We had a problem a year ago because of multi-threading, but we have fixed it and the users asked for it said that now it works for their code. If You use an older version, could You check the latest version?


2) We have a minor memory leaking problem we are investigating now, but it only occured when someone converts a very large number of structures. Is this crash occures when You convert only a few hundred structures, or even less structures, or only one structure? If this is the problem we are rewriting our inchi native calling, and it will be ready soon.


If these do not help please check Your home directory for a .chemaxon directory, find the lib directory in it, and tell me directories are there starting with inchi, and what files do they contain.


Best Regards,


Peter

User 8d34d3a066

28-01-2011 12:55:01

Hi Peter,


We are using version 5.4.0. It looks like this error happens whenver we try and load a single InChI via MolImporter.importMol, we use a version of the image.jsp example page ad pass it an InChI and it brings the VM down. It also happens when we try and pass an InChI to do structure searches too.


The contents of the .chemaxon/lib dir is:


$ ls -l .chemaxon/lib/inchi*

/home/webservice/.chemaxon/lib/inchi-1_1:

total 968

-rw-rw-r-- 1 webservice webservice 986876 Aug 11 10:50 libinchi.so


/home/webservice/.chemaxon/lib/inchi-1_2r:

total 416

-rw-rw-r-- 1 webservice webservice 420789 Oct 12 12:03 libinchi64.so

ChemAxon 7c2d26e5cf

01-02-2011 18:10:32

I have created a small web application to check this issue.


InChi import works fine for me with 5.4.0.0.


Here is my test environment:


64bit Ubuntu Linux 10.10 (kernel: 2.6.35-23-generic)


Java 1.6.0_20:


Java(TM) SE Runtime Environment (build 1.6.0_20-b02)


Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode) 


Marvin Beans version:5.4.0.0


I have attached my JSP example.


I assume the reported issue can be a platform specific Java bug. On an other forum, similar issue has been also reported.


http://stackoverflow.com/questions/2247340/jvm-crashes-under-stress-on-rhel-5-2

ChemAxon 7c2d26e5cf

01-02-2011 18:18:55

I have some technical problem with upload on the forum.


So I placed the example file into a separate server where you can access it.


inchi.jsp.zip