openbabel / openbabel

Open Babel is a chemical toolbox designed to speak the many languages of chemical data.
http://openbabel.org/
GNU General Public License v2.0
1.08k stars 414 forks source link

Crash reading G03 in beta symmetry pushback #1208

Closed openbabel-bot closed 7 years ago

openbabel-bot commented 12 years ago

Line 742 of gaussformat.cpp is:

742 betaSymmetries.push_back(symmetries[i]);

Reported by: @mbanck

Original Ticket: openbabel/bugs/828

openbabel-bot commented 12 years ago

Thank you SF, it cropped most of my description after complaining the attached file was too large :(

Here goes:

Reading http://cclib.svn.sourceforge.net/viewvc/cclib/trunk/data/Gaussian/basicGaussian03/dvb_un_sp.out?revision=640

with gaussformat results in a segfault:

0 0x00007ffff6fcadd8 in std::basic_string<char, std::char_traits, std::allocator >::basic_string(std::string const&) () from /usr/lib/libstdc++.so.6

1 0x00000000004052f8 in gnu_cxx::new_allocator::construct (this=0x7fffffffbf80, position=..., __x=...) at /usr/include/c++/4.4/ext/new_allocator.h:105

2 std::vector<std::string, std::allocator >::_M_insert_aux (this=0x7fffffffbf80, position=..., x=...) at /usr/include/c++/4.4/bits/vector.tcc:330

3 0x00007ffff1cf7232 in std::vector<std::string, std::allocator >::push_back (this=, pOb=, pConv=)

at /usr/include/c++/4.4/bits/stl_vector.h:741

4 OpenBabel::GaussianOutputFormat::ReadMolecule (this=, pOb=, pConv=)

at /build/openbabel-UwmzPj/openbabel-2.3.1+dfsg/src/formats/gaussformat.cpp:742

5 0x00007ffff77dddc8 in OpenBabel::OBMoleculeFormat::ReadChemObjectImpl (pConv=, pFormat=)

at /build/openbabel-UwmzPj/openbabel-2.3.1+dfsg/src/obmolecformat.cpp:105

6 0x00007ffff77828d8 in OpenBabel::OBConversion::Convert (this=0x7fffffffe290) at /build/openbabel-UwmzPj/openbabel-2.3.1+dfsg/src/obconversion.cpp:515

7 0x00007ffff7782fbd in OpenBabel::OBConversion::Convert (this=0x7fffffffe290, is=0x7fffffffd500, os=0x606a60) at /build/openbabel-UwmzPj/openbabel-2.3.1+dfsg/src/obconversion.cpp:448

8 0x00007ffff7788f56 in OpenBabel::OBConversion::FullConvert (this=, FileList=, OutputFileName=, OutputFileList=)

at /build/openbabel-UwmzPj/openbabel-2.3.1+dfsg/src/obconversion.cpp:1410

9 0x00000000004043cf in main (argc=, argv=0x7fffffffe5a8) at /build/openbabel-UwmzPj/openbabel-2.3.1+dfsg/tools/babel.cpp:347

Line 742 of gaussformat.cpp is:

742 betaSymmetries.push_back(symmetries[i]);

Original comment by: @mbanck

openbabel-bot commented 12 years ago

The molecule has no symmetry, but the open shell parsing code was trying to unconditionally set the beta orbital symmetry strings. This has been fixed in revision r5011 (but I have not verified whether the parsed orbital data is actually accurate now).

Original comment by: @mbanck