You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open Babel version: 3.0.0
Operating system and version: Ubuntu 18.04
Expected Behavior
No floating point exception. I think there needs to be a check in vector3::normalize() for zero vectors since it is very hard to guarantee that no callers ever have a zero vector.
Actual Behavior
vector3::normalize() gets a zero vector.
Thread 3 "bfd-server-debu" received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0x7ffff5fc2700 (LWP 9010)]
0x0000000000dc98c9 in OpenBabel::vector3::normalize() ()
(gdb) bt
#0 0x0000000000dc98c9 in OpenBabel::vector3::normalize() () #1 0x0000000000e0543f in OpenBabel::OBBuilder::GetNewBondVector(OpenBabel::OBAtom*, double) () #2 0x0000000000b4723b in OpenBabel::OBMol::AddNewHydrogens(OpenBabel::HydrogenType, bool, double)
() #3 0x0000000000d1b06f in OpenBabel::OBGroupContrib::Predict(OpenBabel::OBBase*, std::__cxx11::basic_string<char, std::char_traits, std::allocator >*) ()
Steps to Reproduce
This happens with any PDB structure containing the PA0 ligand (e.g. 3E3Z), a phenyl ring with arsenic attached. Getting the logP property. Example code (the 'content' string contains a mol format string with the PA0 compound:
Environment Information
Open Babel version: 3.0.0
Operating system and version: Ubuntu 18.04
Expected Behavior
No floating point exception. I think there needs to be a check in vector3::normalize() for zero vectors since it is very hard to guarantee that no callers ever have a zero vector.
Actual Behavior
vector3::normalize() gets a zero vector.
Thread 3 "bfd-server-debu" received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0x7ffff5fc2700 (LWP 9010)]
0x0000000000dc98c9 in OpenBabel::vector3::normalize() ()
(gdb) bt
#0 0x0000000000dc98c9 in OpenBabel::vector3::normalize() ()
#1 0x0000000000e0543f in OpenBabel::OBBuilder::GetNewBondVector(OpenBabel::OBAtom*, double) ()
#2 0x0000000000b4723b in OpenBabel::OBMol::AddNewHydrogens(OpenBabel::HydrogenType, bool, double)
()
#3 0x0000000000d1b06f in OpenBabel::OBGroupContrib::Predict(OpenBabel::OBBase*, std::__cxx11::basic_string<char, std::char_traits, std::allocator >*) ()
Steps to Reproduce
This happens with any PDB structure containing the PA0 ligand (e.g. 3E3Z), a phenyl ring with arsenic attached. Getting the logP property. Example code (the 'content' string contains a mol format string with the PA0 compound:
std::ios_base::openmode imode = std::ios_base::in|std::ios_base::binary;
std::ios_base::openmode omode = std::ios_base::out|std::ios_base::binary;
std::stringstream ssi(content, imode);
std::stringstream sso("", omode);
OpenBabel::OBConversion conv(&ssi, &sso);
OpenBabel::OBFormat* molformat = conv.FindFormat("mol");
conv.SetInFormat(molformat);
OpenBabel::OBMol mol;
molformat->ReadMolecule(&mol, &conv);
json js;
OpenBabel::OBDescriptor* pDesc = OpenBabel::OBDescriptor::FindType("logP");
if(pDesc) js["LogP"] = pDesc->Predict(&mol);
mol string for PA0.178:A:
PA0
JL BFD1119190613
Written by the BioLeap Fragment Displayer(TM)[BioLeap, Inc.]
12 12 0 0 0 0 0 0 0 0999 V2000
7.2100 -10.0520 2.6110 As 0 3 0 0 0 0 0 0 0 1 0 0
7.1560 -10.0390 1.2400 C 0 0 0 0 0 0 0 0 0 2 0 0
6.2490 -9.2320 0.5650 C 0 0 0 0 0 0 0 0 0 3 0 0
6.2170 -9.2220 -0.8210 C 0 0 0 0 0 0 0 0 0 4 0 0
7.0890 -10.0140 -1.5640 C 0 0 0 0 0 0 0 0 0 5 0 0
8.0000 -10.8330 -0.9030 C 0 0 0 0 0 0 0 0 0 6 0 0
8.0240 -10.8420 0.4890 C 0 0 0 0 0 0 0 0 0 7 0 0
8.6560 -11.4170 0.9490 H 0 0 0 0 0 0 0 0 0 8 0 0
8.6120 -11.3920 -1.4070 H 0 0 0 0 0 0 0 0 0 9 0 0
7.0620 -9.9950 -2.5330 H 0 0 0 0 0 0 0 0 0 10 0 0
5.5780 -8.6550 -1.2800 H 0 0 0 0 0 0 0 0 0 11 0 0
5.6350 -8.6730 1.0660 H 0 0 0 0 0 0 0 0 0 12 0 0
1 2 1 0 0 0 0
2 3 2 0 0 0 0
2 7 1 0 0 0 0
3 4 1 0 0 0 0
4 5 2 0 0 0 0
5 6 1 0 0 0 0
7 6 2 0 0 0 0
3 12 1 0 0 0 0
4 11 1 0 0 0 0
5 10 1 0 0 0 0
6 9 1 0 0 0 0
7 8 1 0 0 0 0
M END
The text was updated successfully, but these errors were encountered: