Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault within coordgen for molecule #106

Open
greglandrum opened this issue Jan 4, 2022 · 0 comments
Open

Segfault within coordgen for molecule #106

greglandrum opened this issue Jan 4, 2022 · 0 comments
Assignees
Labels

Comments

@greglandrum
Copy link
Collaborator

greglandrum commented Jan 4, 2022

This one was reported by @lucasmorin222 in the RDKit tracker (rdkit/rdkit#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.

@greglandrum greglandrum self-assigned this Jan 4, 2022
@greglandrum greglandrum added the bug label Jan 4, 2022
greglandrum added a commit to greglandrum/coordgenlibs that referenced this issue Jan 4, 2022
d-b-w pushed a commit that referenced this issue Jan 5, 2022
But it doesn't address the root issue of NaN coordinates.
d-b-w added a commit that referenced this issue Jan 11, 2022
* Refactor clockwiseOrderedNeighbors() to avoid NaN SEGV

Although the SEGV when coordinates are NaN has already been
bypassed, I refactored this function when trying to understand
what it did. I find this version more readable, it also happens
to be more efficient (although that probably doesn't matter
with 3-5 substituents).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant