Dear RDKit community,
I am using rdkit 2019.09.3 on Ubuntu 20.04 focal, and for certain inputs
like the one specified below I get a Segmentation Fault.
Here is a minimal script to reproduce the error as well as the two sdf
that caused the error.
from rdkit import Chem
from rdkit.Chem import rdchem
mol = Chem.SDMolSupplier('input.sdf', removeHs=False)[0]
flags = flags = Chem.KEKULE_ALL | Chem.ALLOW_INCOMPLETE_OCTETS |
Chem.ALLOW_CHARGE_SEPARATION | Chem.UNCONSTRAINED_ANIONS |
Chem.UNCONSTRAINED_CATIONS
suppl = rdchem.ResonanceMolSupplier(mol, flags=flags)
if suppl:
mol2 = [m for m in suppl][0]
RDKit 3D
24 26 0 0 0 0 0 0 0 0999 V2000
3.7865 -0.2900 0.6422 C 0 0 0 0 0 0 0 0 0 0 0 0
3.6385 0.6315 -0.3412 C 0 0 0 0 0 0 0 0 0 0 0 0
2.3608 0.9715 -0.8135 C 0 0 0 0 0 0 0 0 0 0 0 0
1.1943 0.3935 -0.3100 C 0 0 0 0 0 0 0 0 0 0 0 0
1.2965 -0.5663 0.7084 C 0 0 0 0 0 0 0 0 0 0 0 0
2.6181 -0.9571 1.2400 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.0570 -1.3484 1.4078 S 0 0 0 0 0 0 0 0 0 0 0 0
-1.4374 -0.6473 0.5380 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.2617 0.3162 -0.4562 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.0175 0.7796 -0.8241 N 0 0 0 0 0 0 0 0 0 0 0 0
-2.3988 0.8168 -1.0899 C 0 0 0 0 0 0 0 0 0 0 0 0
-3.6585 0.3681 -0.7403 C 0 0 0 0 0 0 0 0 0 0 0 0
-3.8156 -0.5908 0.2494 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.6995 -1.0990 0.8898 C 0 0 0 0 0 0 0 0 0 0 0 0
4.7582 -0.5638 1.0181 H 0 0 0 0 0 0 0 0 0 0 0 0
4.4954 1.1188 -0.7771 H 0 0 0 0 0 0 0 0 0 0 0 0
2.2733 1.7084 -1.5969 H 0 0 0 0 0 0 0 0 0 0 0 0
2.6397 -0.8019 2.3282 H 0 0 0 0 0 0 0 0 0 0 0 0
-0.0002 1.4769 -1.5560 H 0 0 0 0 0 0 0 0 0 0 0 0
-2.2855 1.5626 -1.8612 H 0 0 0 0 0 0 0 0 0 0 0 0
-4.5238 0.7690 -1.2439 H 0 0 0 0 0 0 0 0 0 0 0 0
-4.7977 -0.9409 0.5214 H 0 0 0 0 0 0 0 0 0 0 0 0
-2.8007 -1.8452 1.6623 H 0 0 0 0 0 0 0 0 0 0 0 0
2.7459 -2.0453 1.1511 H 0 0 0 0 0 0 0 0 0 0 0 0
15 1 1 0
16 2 1 0
17 3 1 0
18 6 1 0
19 10 1 0
20 11 1 0
21 12 1 0
22 13 1 0
23 14 1 0
24 6 1 0
11 12 4 0
13 14 4 0
4 10 1 0
10 9 1 0
9 8 4 0
8 7 1 0
2 3 1 0
4 5 1 0
5 6 1 0
6 1 1 0
1 2 2 0
3 4 2 0
5 7 2 0
8 14 4 0
9 11 4 0
12 13 4 0
M CHG 1 7 1
V 1 C
M END
$$$$
RDKit 3D
23 25 0 0 0 0 0 0 0 0999 V2000
0.3053 3.6659 0.0544 O 0 0 0 0 0 0 0 0 0 0 0 0
-0.1542 2.5093 0.0748 N 0 0 0 0 0 0 0 0 0 0 0 0
-1.5618 2.3423 0.0180 O 0 0 0 0 0 0 0 0 0 0 0 0
0.4179 1.3007 0.1430 C 0 0 0 0 0 0 0 0 0 0 0 0
1.7461 0.8529 0.2172 C 0 0 0 0 0 0 0 0 0 0 0 0
1.9320 -0.5143 0.2726 C 0 0 0 0 0 0 0 0 0 0 0 0
0.8664 -1.4626 0.2581 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.4354 -1.0479 0.1863 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.6211 0.3406 0.1300 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.8191 1.0230 0.0528 C 0 0 0 0 0 0 0 0 0 0 0 0
-3.0437 0.2952 0.0215 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.9565 -1.0485 0.0711 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.6963 -1.8573 0.1583 C 0 0 0 0 0 0 0 0 0 0 0 0
3.3058 -1.0642 0.3525 C 0 0 0 0 0 0 0 0 0 0 0 0
3.5605 -2.2494 0.4147 O 0 0 0 0 0 0 0 0 0 0 0 0
4.2582 -0.1354 0.3501 O 0 0 0 0 0 0 0 0 0 0 0 0
2.5743 1.5404 0.2298 H 0 0 0 0 0 0 0 0 0 0 0 0
1.1370 -2.5054 0.3065 H 0 0 0 0 0 0 0 0 0 0 0 0
-3.9845 0.8147 -0.0397 H 0 0 0 0 0 0 0 0 0 0 0 0
-3.8648 -1.6307 0.0494 H 0 0 0 0 0 0 0 0 0 0 0 0
-1.7515 -2.4890 1.0517 H 0 0 0 0 0 0 0 0 0 0 0 0
5.1452 -0.5339 0.4038 H 0 0 0 0 0 0 0 0 0 0 0 0
-1.6720 -2.5533 -0.6873 H 0 0 0 0 0 0 0 0 0 0 0 0
2 1 1 0
14 6 1 0
15 14 2 0
16 14 1 0
17 5 1 0
18 7 1 0
19 11 1 0
20 12 1 0
21 13 1 0
22 16 1 0
23 13 1 0
3 10 1 0
4 2 1 0
2 3 1 0
10 9 1 0
8 13 1 0
13 12 1 0
12 11 1 0
9 4 4 0
5 6 4 0
7 8 4 0
4 5 4 0
6 7 4 0
8 9 4 0
10 11 2 0
V 1 O
M END
$$$$
The molecule was created using rdkit rwmol module and the mol works with
every other functions including Chem.SanitizeMol(mol). The sdf was
generated using rdkit.
The segfault occurs when accessing the supplier.
Would you know any way to fix/circumvent/predict the segfault happening ?
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss