Mutliplication of threads.

User 761d9eb85b

10-03-2011 14:24:57

Hi,


 


We are experiencing an issue with the JChem (.NET, latest version) structure to name feature. When we try to generate a IUPAC name from a big molecule (multiple hundreds of atoms, in mol format) server-side, the following happens :


 




 



 


The major issue is not that the IUPAC naming fails, this would not be an issue at all if we could react accordingly to the JChem failure. But in our case, when the exception is raised, it is already too late, the server will hang minutes later.


 


Do you know anything about this kind of issue ?


 


Best Regards,


JC


 


Edit  : this topic is not in the right forum. Can an admin move it in the naming forum ? Thank you.

ChemAxon e7b9408ca1

10-03-2011 14:43:01

Hello,


We will investigate. Which version of jchem is this happening on?


Daniel

User 761d9eb85b

10-03-2011 14:45:24

Whe are using the JChem .NET API 5.4.1.1062 (downloaded yesterday).

ChemAxon e7b9408ca1

10-03-2011 15:04:18

Thank you. Sorry, I forgot to ask, could you also include the complete output from the console?

ChemAxon a9ded07333

11-03-2011 09:45:10

I've moved the topic to the naming forum.


Tamas

ChemAxon e7b9408ca1

11-03-2011 09:59:25

Also, would it be possible that you share the molecule in question?


Since the consequences are quite serious, i would suggest to work around it until we can relase a fix. Probably a good way would be to check the number of bonds (probably more significant than the number of atoms) with m.getBondCount() and skip the name generation if it is above a given value (e.g. 100).

User 761d9eb85b

14-03-2011 14:38:00

OK, so, the problem is still here. We are experiencing this issue even with some smaller size molecules, but only on the production server, not in our development servers.


I have added an example of both type of crashing reactions as attachments.


 


The last file is what is written in the console when pasting the reaction in marvin (client side). The molecule is then send to the server side, by using one of our services, and then parse on the server side.


 


Many exceptions are thrown by the chemaxon calls (is it normal ?), but the relevant exceptions are from line 84 to 99.


 


Best regards,


JC

User 761d9eb85b

15-03-2011 09:39:15

OK, so I am investing right now and here is what I have found :


-The small structure does not crash on Name to Structure, but just a step later, when we do a search in the JChem database ( a duplicate search). The code is :


 


 JChemSearch searchObject = new JChemSearch();
            var connHandler = GetJChemConnectionHandler();
            if (connHandler == null)
                throw new Exception("Error in BuildJChemSearchHandler : no JChemConnectionHandler created");
            searchObject.setQueryStructure(structure);
            searchObject.setConnectionHandler(connHandler);
            searchObject.setStructureTable(tableName);

            chemaxon.sss.search.JChemSearchOptions searchOption = new chemaxon.sss.search.JChemSearchOptions();
            searchOption.setSearchType(chemaxon.sss.SearchConstants.__Fields.DUPLICATE);

            searchObject.setSearchOptions(searchOption);
            searchObject.setRunMode(JChemSearch.RUN_MODE_SYNCH_COMPLETE);
searchObject.run();

int resultCount = searchObject.getResultCount();




The webserver process start the search process (searchObjects.run() ) but nevers goes to the next line. The CPU stays at 25% (quad core)

We have tried to create a new (empty) JChem base with JChemManager 5.4.1.1 but we are still experiencing the same issue.

So, to recapitulate, we have 3 crashes :

- Large structures create multiple threads, and prevent the webserver process to continue.
- Some small structure crash the webserver when doing jchem searches.
- Some names like 'THF' crashes the server (as mentioned in my other post : https://www.chemaxon.com/forum/ftopic7275.html ) when doing a structure to name, like 'THF'.

Best regards,
JC

User 761d9eb85b

15-03-2011 13:12:48

I just have installed IIS on the current development server. We still have the problem about small structures and 'THF' in IIS, but not in the Visual Studio Web server. Large structures crash on both servers. This exclude a wrong jchem installation on the server.

ChemAxon e7b9408ca1

15-03-2011 20:37:23

Thank you for all the additional information. I could make an improvement regarding the naming of large structures. However, it seems that there is an additional, .NET-specific problem on top of that. Are you in position to do the filtering based on the number of bonds that I proposed, as a workaround until we can release a fix?


We are working on the different issues, and will keep you updated as we know more.

ChemAxon eb65a25631

04-04-2011 14:47:49

The root of the issue is a bug inside the .NET 4 CLR Optimizer. Microsoft is aware of the bug, though no fix officially known to be released.


It can be avoided by using older frameworks.


https://connect.microsoft.com/VisualStudio/feedback/details/566946/x64-jit-optimization-bug


Or, substituting the code with a different one, where the optimizer fails. (We changed the implementation of jaja.lang.Long.trailingZeroes() and the problem ceased to exist.)