schrodinger / coordgenlibs

Schrodinger-developed 2D Coordinate Generation
BSD 3-Clause "New" or "Revised" License
42 stars 28 forks source link

Segfault within coordgen for molecule #106

Open greglandrum opened 2 years ago

greglandrum commented 2 years ago

This one was reported by @lucasmorin222 in the RDKit tracker (https://github.com/rdkit/rdkit/issues/4845), but I've confirmed that it's a coordgen problem.

I don't have a straight reproducible for coordgen, but this bit of C++ using RDKit+Coordgen results in a segfault:

    auto m1 = "C1C=CC=C2C1=CSC=C3C(=O)OOOC(=O)C(=CC(=O)N3)OC2=O"_smiles;
    CoordGen::addCoords(*m1);

The crash occurs here: https://github.com/schrodinger/coordgenlibs/blob/master/sketcherMinimizerAtom.cpp#L377 because lastPoppedIndex is 1 and neighs.size() is 1.

I'll do a PR.