All, Doug Houston kindly pointed me to a situation in which Sieve was crashing when the program was run on an input file that contains counterions in combination with filter criteria that use SMARTS pattern matching functions (in particular, the LOGS and LOGP filters). I've attached one of Doug's molecules for convenience. The command that he used was: sieve --in 9SPH1-198-630.sdf --filter filter.txt --pass passed.sdf The 'filter.txt' file contained a "LOGS -5 *" filter line. The problem is repeatable and also occurs on other molecules with counterions. Sieve does not crash when the "--salts" commandline option is used, or when other filters, like the MOLWT filter, are used. I spent some time trying to identify the cause of this crash, and came to the conclusion that it has to do with the combination of first calling the OBMol::StripSalts() method, followed by calling the OBSmartsPattern::Match() method. However, I still do not completely understand the exact reason for this segmentation fault, but when I replace the OBMol::StripSalts() method call within Sieve by an alternative function that does exactly the same as the original OBMol::StripSalts() method, then a crash seems to be avoided. I guess that the OBMol::StripSalts() method modifies the original molecule in such a way that some kind of inconsistencies are introduced in the connection table (?) which lead to a crash of the system when the OBSmartsPattern::Match() method is subsequently called. I've attached the code of the 'StripSalts' replacement function that does not lead to a crash. If you all agree, I could use this code to correct the existing OBMol::StripSalts() code, unless one is willing to have a look at the OBMol::StripSalts() code and identify the exact source of the error. This would be a less pragmatic fix but maybe nobody has time to have a look at this. Please let me know your thoughts. Hans |
9SPH1-198-630.sdf
Description: Binary data
stripSalts.cpp
Description: Binary data
------------------------------------------------------------------------------ Achieve Improved Network Security with IP and DNS Reputation. Defend against bad network traffic, including botnets, malware, phishing sites, and compromised hosts - saving your company time, money, and embarrassment. Learn More! http://p.sf.net/sfu/hpdev2dev-nov
_______________________________________________ OpenBabel-Devel mailing list OpenBabel-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-devel