stack overflow error

User 870ab5b546

27-09-2007 19:30:07

Hi,





I recently received this output in my log:





Code:
After adding stereo and removing maps but before specifying unspecified configurations, Reactor products are: [Br-].O[H].CCC=C=CCC


java.lang.StackOverflowError


        at chemaxon.struc.CGraph.incGrinvCC(CGraph.java:1270)


        at chemaxon.struc.CGraph.resetCtab(CGraph.java:1595)


        at chemaxon.struc.CGraph.removeEdge0(CGraph.java:843)


        at chemaxon.struc.CGraph.removeEdge(CGraph.java:795)


        at chemaxon.struc.CGraph.removeNode0(CGraph.java:777)


        at chemaxon.struc.CGraph.removeNode(CGraph.java:753)


        at chemaxon.struc.MoleculeGraph.removeNode0(MoleculeGraph.java:504)


        at chemaxon.struc.MoleculeGraph.removeNode(MoleculeGraph.java:464)


        at chemaxon.struc.CGraph.endNodeCorruption(CGraph.java:1520)


        at chemaxon.struc.CGraph.findFrags(CGraph.java:1441)


        at chemaxon.marvin.modules.Clean2D.startClean(Clean2D.java:374)


        at chemaxon.marvin.modules.Clean2D.rearrangeCTBond(Clean2D.java:3822)


        at chemaxon.marvin.modules.Clean2D.setStereo(Clean2D.java:3626)


        at chemaxon.marvin.modules.Clean2D.startClean(Clean2D.java:487)


        at chemaxon.marvin.modules.Clean2D.rearrangeCTBond(Clean2D.java:3822)


        at chemaxon.marvin.modules.Clean2D.setStereo(Clean2D.java:3626)


        at chemaxon.marvin.modules.Clean2D.startClean(Clean2D.java:487)


        at chemaxon.marvin.modules.Clean2D.rearrangeCTBond(Clean2D.java:3822)


        at chemaxon.marvin.modules.Clean2D.setStereo(Clean2D.java:3626)


        at chemaxon.marvin.modules.Clean2D.startClean(Clean2D.java:487)


        at chemaxon.marvin.modules.Clean2D.rearrangeCTBond(Clean2D.java:3822)


        at chemaxon.marvin.modules.Clean2D.setStereo(Clean2D.java:3626)


...






It just keeps repeating those last three lines.





I'm guessing it's confused by the allene.

ChemAxon d76e6e95eb

28-09-2007 13:00:58

Could you please provide the input files and the jchem version for reproducing the error?

User 870ab5b546

28-09-2007 14:53:22

The JChem version is 3.2.11.





Input MRV is:





Code:
<?xml version="1.0" ?>


<MDocument>


  <MChemicalStruct>


    <molecule molID="m1">


      <atomArray


          atomID="a1 a2 a3 a4 a5 a6 a7"


          elementType="C C C C C C C"


          />


      <bondArray>


        <bond atomRefs2="a1 a2" order="1" />


        <bond atomRefs2="a2 a3" order="1" />


        <bond atomRefs2="a3 a4" order="2">


          <bondStereo>T</bondStereo>


        </bond>


        <bond atomRefs2="a4 a5" order="2" />


        <bond atomRefs2="a5 a6" order="1" />


        <bond atomRefs2="a6 a7" order="1" />


      </bondArray>


    </molecule>


  </MChemicalStruct>


</MDocument>






The stack looked a little different this time:


Code:
java.lang.StackOverflowError


        at chemaxon.marvin.modules.Clean2D.checkLastCross(Clean2D.java:3432)


        at chemaxon.marvin.modules.Clean2D.fixAtom(Clean2D.java:1916)


        at chemaxon.marvin.modules.Clean2D.fixAtom(Clean2D.java:1926)


        at chemaxon.marvin.modules.Clean2D.calcInitGeom(Clean2D.java:776)


        at chemaxon.marvin.modules.Clean2D.startClean(Clean2D.java:454)


        at chemaxon.marvin.modules.Clean2D.rearrangeCTBond(Clean2D.java:3822)


        at chemaxon.marvin.modules.Clean2D.setStereo(Clean2D.java:3626)


        at chemaxon.marvin.modules.Clean2D.startClean(Clean2D.java:487)


        at chemaxon.marvin.modules.Clean2D.rearrangeCTBond(Clean2D.java:3822)


        at chemaxon.marvin.modules.Clean2D.setStereo(Clean2D.java:3626)


        ...

ChemAxon e08c317633

01-10-2007 08:40:19

Bob,





Please also attach (or send in email) the code, that caused the exception.





Regards,


Zsolt

User 870ab5b546

01-10-2007 12:49:20

Code:
   public static ArrayList<Molecule> specifyUnspecifiedConfigs(Molecule cpd) {


        ArrayList<Molecule> stereoisomers = new ArrayList<Molecule>();


        if (cpd.getDim() == 0) {


            System.out.println("Zero-dimensional compound:\n" + cpd.toFormat("mrv"));


            cpd.clean(2, null); // don't use setDim(), it messes up coordinates


            System.out.println("Two-dimensional compound:\n" + cpd.toFormat("mrv"));


        }






You can see from the trace below that the error is thrown by Molecule.clean(2, null).





Code:
2007-10-01 08:45:46 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception


java.lang.StackOverflowError


        at java.lang.Exception.<init>(Exception.java:77)


        at java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:54)


        at sun.reflect.GeneratedConstructorAccessor586.newInstance(Unknown Source)


        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)


        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)


        at java.lang.Class.newInstance0(Class.java:350)


        at java.lang.Class.newInstance(Class.java:303)


        at chemaxon.struc.CGraph.findFrags(CGraph.java:1425)


        at chemaxon.struc.Molecule.findFrags(Molecule.java:2353)


        at chemaxon.marvin.modules.SSSR.startRingSearch(SSSR.java:498)


        at chemaxon.marvin.modules.SSSR.callback(SSSR.java:1177)


        at chemaxon.struc.CGraph.getSSSR(CGraph.java:1189)


        at chemaxon.marvin.modules.Clean2D.startClean(Clean2D.java:438)


        at chemaxon.marvin.modules.Clean2D.rearrangeCTBond(Clean2D.java:3822)


        at chemaxon.marvin.modules.Clean2D.setStereo(Clean2D.java:3626)


        at chemaxon.marvin.modules.Clean2D.startClean(Clean2D.java:487)


        at chemaxon.marvin.modules.Clean2D.rearrangeCTBond(Clean2D.java:3822)


        at chemaxon.marvin.modules.Clean2D.setStereo(Clean2D.java:3626)


        at chemaxon.marvin.modules.Clean2D.startClean(Clean2D.java:487)


        at chemaxon.marvin.modules.Clean2D.rearrangeCTBond(Clean2D.java:3822)


        at chemaxon.marvin.modules.Clean2D.setStereo(Clean2D.java:3626)


        at chemaxon.marvin.modules.Clean2D.startClean(Clean2D.java:487)


        at chemaxon.marvin.modules.Clean2D.rearrangeCTBond(Clean2D.java:3822)


        at chemaxon.marvin.modules.Clean2D.setStereo(Clean2D.java:3626)


        at chemaxon.marvin.modules.Clean2D.startClean(Clean2D.java:487)


        at chemaxon.marvin.modules.Clean2D.rearrangeCTBond(Clean2D.java:3822)


        at chemaxon.marvin.modules.Clean2D.setStereo(Clean2D.java:3626)


        at chemaxon.marvin.modules.Clean2D.startClean(Clean2D.java:487)





...








2007-10-01 08:58:49 SynthSolver.getProducts: Initial substrates are 2: CC\C(Br)=C\C.[OH-]


Entering getProducts().


At beginning of new reaction definition.


There are more reaction definitions after this one; next divider is ***RESUBJECT_TO***.


Submitting for calculation.











Reaction: E2 base(-)noSelec H-C-C-X


calcProducts: Reaction: E2 base(-)noSelec H-C-C-X; submitting substrates for the 1st time.


This time, reaction products are: {}


Submitting substrate array 1 to Reactor: [OH-].CC\C(Br)=C\C


Product set 1 from Reactor for permutation 1 is empty; breaking.


Product set 1 obtained from Reactor.


Initial substrates reacted to give 3 products: [Br-:3].[OH:2][H:5].CC=[C:1]=[CH:4]C


After adding stereo and removing maps but before specifying unspecified configurations, Reactor products are: [Br-].O[H].CC=C=CC


Zero-dimensional compound:


<?xml version="1.0" ?>


<MDocument>


  <MChemicalStruct>


    <molecule molID="m1">


      <atomArray


          atomID="a1 a2"


          elementType="H O"


          />


      <bondArray>


        <bond atomRefs2="a2 a1" order="1" />


      </bondArray>


    </molecule>


  </MChemicalStruct>


</MDocument>





Two-dimensional compound:


<?xml version="1.0" ?>


<MDocument>


  <MChemicalStruct>


    <molecule molID="m1">


      <atomArray


          atomID="a1 a2"


          elementType="H O"


          x2="0.0 1.54"


          y2="0.0 0.0"


          />


      <bondArray>


        <bond atomRefs2="a2 a1" order="1" />


      </bondArray>


    </molecule>


  </MChemicalStruct>


</MDocument>





Zero-dimensional compound:


<?xml version="1.0" ?>


<MDocument>


  <MChemicalStruct>


    <molecule molID="m1">


      <atomArray


          atomID="a1"


          elementType="Br"


          formalCharge="-1"


          />


      <bondArray>


      </bondArray>


    </molecule>


  </MChemicalStruct>


</MDocument>





Two-dimensional compound:


<?xml version="1.0" ?>


<MDocument>


  <MChemicalStruct>


    <molecule molID="m1">


      <atomArray


          atomID="a1"


          elementType="Br"


          formalCharge="-1"


          x2="0.0"


          y2="0.0"


          />


      <bondArray>


      </bondArray>


    </molecule>


  </MChemicalStruct>


</MDocument>





Zero-dimensional compound:


<?xml version="1.0" ?>


<MDocument>


  <MChemicalStruct>


    <molecule molID="m1">


      <atomArray


          atomID="a1 a2 a3 a4 a5"


          elementType="C C C C C"


          />


      <bondArray>


        <bond atomRefs2="a1 a2" order="1" />


        <bond atomRefs2="a2 a3" order="2">


          <bondStereo>T</bondStereo>


        </bond>


        <bond atomRefs2="a3 a4" order="2" />


        <bond atomRefs2="a4 a5" order="1" />


      </bondArray>


    </molecule>


  </MChemicalStruct>


</MDocument>

ChemAxon e08c317633

02-10-2007 15:29:31

Bob, please attach a Java source file that (after we compile it) we can use to reproduce the error (will throw exception when we run it).





Regards,


Zsolt

User 870ab5b546

02-10-2007 15:33:06

I will send by email.