girke-lab / ChemmineOB

OpenBabel wrapper package for R
Other
9 stars 5 forks source link

Segmentation Faults #16

Closed reventropy closed 4 years ago

reventropy commented 5 years ago

I'm trying to generate molecular fingerprints for many thousands of SMILES ids. Two of the fingerprint (FP3,FP4) functions died on a segmentation fault at different ids. I'll see if I can reproduce the behavior on the SMILES it failed on.


#segfault 1
[1] 279054

 *** caught segfault ***
address 0x20, cause 'memory not mapped'

Traceback:
 1: .Call("R_swig_OBFingerprint_GetFingerprint__SWIG_1", self, pOb,     fp, as.logical(.copy), PACKAGE = "ChemmineOB")
 2: f(...)
 3: OBFingerprint_GetFingerprint(fpHandle, mol, fp)
 4: (function (mol) {    fp = vectorUnsignedInt(1)    OBFingerprint_GetFingerprint(fpHandle, mol, fp)    if (numBits == -1)         numBits = vectorUnsignedInt_size(fp) * 4 * 8    row = unlist(Map(function(i) {        r = OBFingerprint_GetBit(fpHandle, fp, i - 1)        if (r)             1        else 0    }, seq(1, numBits, length.out = numBits)))    if (debug)         print(row)    row})(dots[[1L]][[1L]])
 5: mapply(FUN = f, ..., SIMPLIFY = FALSE)
 6: Map(function(mol) {    fp = vectorUnsignedInt(1)    OBFingerprint_GetFingerprint(fpHandle, mol, fp)    if (numBits == -1)         numBits = vectorUnsignedInt_size(fp) * 4 * 8    row = unlist(Map(function(i) {        r = OBFingerprint_GetBit(fpHandle, fp, i - 1)        if (r)             1        else 0    }, seq(1, numBits, length.out = numBits)))    if (debug)         print(row)    row}, obmolRefs)
 7: Reduce(rbind, Map(function(mol) {    fp = vectorUnsignedInt(1)    OBFingerprint_GetFingerprint(fpHandle, mol, fp)    if (numBits == -1)         numBits = vectorUnsignedInt_size(fp) * 4 * 8    row = unlist(Map(function(i) {        r = OBFingerprint_GetBit(fpHandle, fp, i - 1)        if (r)             1        else 0    }, seq(1, numBits, length.out = numBits)))    if (debug)         print(row)    row}, obmolRefs))
 8: fingerprint_OB(molRefs, "FP3")
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault

#segfault2

[1] 22200

 *** caught segfault ***
address (nil), cause 'unknown'

Traceback:
 1: rbind(fp_vals, as.numeric(fp))
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault
khoran commented 5 years ago

Yea, if you can send me one of the SMILES strings that causes this I can look into it. Otherwise there's not much I can do. Thanks.