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

RDKFuncs.chargeParent() core dumps when standardization is skipped #2970

Closed
tdudgeon opened this issue Feb 25, 2020 · 2 comments
Closed

RDKFuncs.chargeParent() core dumps when standardization is skipped #2970

tdudgeon opened this issue Feb 25, 2020 · 2 comments
Labels
Milestone

Comments

@tdudgeon
Copy link

Release_2019_09 with Java wrappers, Java 11.

Description:

When using the RDKFuncs.chargeParent() method I get a core dump when the skip_standardize boolean parameter is set to true.

package org.example;


import org.RDKit.CleanupParameters;
import org.RDKit.RDKFuncs;
import org.RDKit.RWMol;

public class StandardizeExample {

    static {
        System.loadLibrary("GraphMolWrap");
    }

    private static CleanupParameters DEFAULT_CLEANUP_PARAMS = RDKFuncs.getDefaultCleanupParameters();

    public static RWMol standardize(String smiles, boolean skipStandardize) {
        RWMol mol = RWMol.MolFromSmiles(smiles);
        RDKFuncs.cleanUp(mol);
        mol = RDKFuncs.chargeParent(mol, DEFAULT_CLEANUP_PARAMS, skipStandardize);
        System.out.println(mol.MolToSmiles());
        return mol;
    }

    public static void main(String[] args) {

        System.out.println("Running with standardize");
        standardize("COC=1C=CC(NC=2N=CN=C3NC=NC23)=CC1", false);

        System.out.println("Running without standardize");
        standardize("COC=1C=CC(NC=2N=CN=C3NC=NC23)=CC1", true);
    }
}

In that example the first invocation succeeds but the second core dumps.
As RDKFuncs.cleanUp(mol) has already been called the molecule will not need standardizing again.

@greglandrum
Copy link
Member

Thanks for reporting this. I will take a look.

@greglandrum greglandrum modified the milestones: 2020_03_1, 2019_09_4 Feb 28, 2020
manangoel99 added a commit to manangoel99/rdkit that referenced this issue Mar 23, 2020
…ent is run with skip_standardize set to true" mentioned in rdkit#2970
@greglandrum greglandrum modified the milestones: 2019_09_4, 2020_03_1 Mar 24, 2020
greglandrum pushed a commit that referenced this issue Mar 24, 2020
#3029)

* This commit fixes the bug "segmenation fault/core dump when chargeParent is run with skip_standardize set to true" mentioned in #2970

* Fixed memory leaks in MolStandardize and deleted variables which aren't required
@greglandrum
Copy link
Member

Fixed in #3029

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

2 participants