Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler segfaulting when compiling gmml #145

Open
gitoliver opened this issue Nov 30, 2022 · 5 comments
Open

Compiler segfaulting when compiling gmml #145

gitoliver opened this issue Nov 30, 2022 · 5 comments
Assignees
Labels

Comments

@gitoliver
Copy link
Contributor

The "fix" is to just compile again. It never happens twice. Does seem to be related to compiling the Glycan/oligosaccharide class. Making note of it here. Not sure how frequent it is inside the dev env, happens relatively frequently (every other build sometimes, then nothing for a run of 20 or so builds) on my bare metal builds. Those numbers are extremely vague I wasn't tracking.
[ 8%] Building CXX object CMakeFiles/gmml.dir/src/Glycan/glycosidiclinkage.cc.o
[ 9%] Building CXX object CMakeFiles/gmml.dir/src/Glycan/monosaccharide.cc.o
[ 9%] Building CXX object CMakeFiles/gmml.dir/src/Glycan/oligosaccharide.cc.o
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/GeometryTopology/grid.cc: In constructor ‘GeometryTopology::Grid::Grid(MolecularModeling::Assembly*, GeometryTopology::Coordinate*, GeometryTopology::Coordinate*, double, double)’:
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/GeometryTopology/grid.cc:19:128: warning: unused parameter ‘ion_radius’ [-Wunused-parameter]
19 | Grid::Grid(MolecularModeling::Assembly assembly, GeometryTopology::Coordinate min, GeometryTopology::Coordinate max, double ion_radius, double ion_charge)
| ~~~~~~~^~~~~~~~~~
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/monosaccharide.cc: In copy constructor ‘Glycan::Monosaccharide::Monosaccharide(const Glycan::Monosaccharide&)’:
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/monosaccharide.cc:22:54: warning: unused parameter ‘mono’ [-Wunused-parameter]
22 | Monosaccharide::Monosaccharide(const Monosaccharide &mono)
| ~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/monosaccharide.cc: In constructor ‘Glycan::Monosaccharide::Monosaccharide(std::string
, std::vectorMolecularModeling::Atom*&, MolecularModeling::Assembly
, std::string)’:
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/monosaccharide.cc:92:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::__cxx11::basic_string >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
92 | for(int i = 0; i < orientations.size(); i++)
| ~~^~~~~~~~~~~~~~~~~~~~~
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/monosaccharide.cc:27:170: warning: unused parameter ‘CCD_Path’ [-Wunused-parameter]
27 | Monosaccharide::Monosaccharide(std::string
cycle_atoms_str, std::vectorMolecularModeling::Atom*& cycle_atoms, MolecularModeling::Assembly* this_assembly, std::string CCD_Path)
| ~~~~~~~~~~~~^~~~~~~~
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/oligosaccharide.cc: In member function ‘void Glycan::Oligosaccharide::Print(std::ostream&)’:
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/oligosaccharide.cc:51:51: warning: unused parameter ‘out’ [-Wunused-parameter]
51 | void Glycan::Oligosaccharide::Print(std::ostream& out)
| ~~~~~~~~~~~~~~^~~
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/monosaccharide.cc: In member function ‘void Glycan::Monosaccharide::CheckMonoNaming(std::string, std::string)’:
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/monosaccharide.cc:1878:58: warning: unused parameter ‘original_residue’ [-Wunused-parameter]
1878 | void Glycan::Monosaccharide::CheckMonoNaming(std::string original_residue, std::string original_residue_id)
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/monosaccharide.cc:1878:88: warning: unused parameter ‘original_residue_id’ [-Wunused-parameter]
1878 | void Glycan::Monosaccharide::CheckMonoNaming(std::string original_residue, std::string original_residue_id)
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/oligosaccharide.cc: In member function ‘void Glycan::Oligosaccharide::indexMono(Glycan::Monosaccharide*, int, std::vectorGlycan::Monosaccharide*&)’:
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/oligosaccharide.cc:1481:26: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::pair<Glycan::GlycosidicLinkage*, Glycan::Monosaccharide*> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
1481 | for(int i = 0; i < thisMono->mono_neighbors_.size(); i++)
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/oligosaccharide.cc:1301:6: internal compiler error: Segmentation fault
1301 | void Glycan::Oligosaccharide::indexMono(Glycan::Monosaccharide* thisMono, int thisIndex, std::vectorGlycan::Monosaccharide* &branchedMonos)
| ^~~~~~
0x7f38078da08f ???
/build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7f38078bb082 __libc_start_main
../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See file:///usr/share/doc/gcc-9/README.Bugs for instructions.
make[3]: *** [CMakeFiles/gmml.dir/build.make:505: CMakeFiles/gmml.dir/src/Glycan/oligosaccharide.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....

@gitoliver gitoliver added the bug label Nov 30, 2022
@gitoliver gitoliver self-assigned this Nov 30, 2022
@gitoliver
Copy link
Contributor Author

[ 8%] Building CXX object CMakeFiles/gmml.dir/src/InternalPrograms/glycosylationSiteFinder.cpp.o
[ 9%] Building CXX object CMakeFiles/gmml.dir/src/MolecularMetadata/glycoprotein.cpp.o
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/InternalPrograms/functionsForGMML.cpp: In function ‘void gmml::WritePDBFile(MolecularModeling::Assembly&, std::string, std::string, bool)’:
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/InternalPrograms/functionsForGMML.cpp:19:9: warning: deleting object of polymorphic class type ‘PdbFileSpace::PdbFile’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
19 | delete outputPdbFile;
| ^~~~~~~~~~~~~
during IPA pass: icf
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/MolecularMetadata/glycoprotein.cpp:119:1: internal compiler error: Segmentation fault
119 | }
| ^
0x7f80c451f08f ???
/build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7f80c4500082 __libc_start_main
../csu/libc-start.c:308
Please submit a full bug report,

@gitoliver
Copy link
Contributor Author

In file included from /usr/include/c++/9/functional:54,
from /usr/include/c++/9/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/9/algorithm:71,
from /usr/include/c++/9/regex:38,
from /home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/MolecularModeling/TemplateGraph/GraphStructure/include/././../../AbstractObject/includes/Labels.hpp:4,
from /home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/MolecularModeling/TemplateGraph/GraphStructure/include/././../../AbstractObject/includes/AbstractObject.hpp:4,
from /home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/MolecularModeling/TemplateGraph/GraphStructure/include/././GenericGraphObject.hpp:6,
from /home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/MolecularModeling/TemplateGraph/GraphStructure/include/./Edge.hpp:5,
from /home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/MolecularModeling/TemplateGraph/GraphStructure/include/Node.hpp:5,
from /home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/CentralDataStructure/atom.hpp:8,
from /home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/CentralDataStructure/residue.hpp:4,
from /home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/CentralDataStructure/molecule.hpp:4,
from /home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/CentralDataStructure/assembly.hpp:4,
from /home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/CentralDataStructure/ensemble.hpp:4,
from /home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/InputSet/PdbFile/pdbFile.hpp:18,
from /home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/Glycan/ontologyGmmlInterface.hpp:5,
from /home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/ontologyGmmlInterface.cpp:1:
/usr/include/c++/9/tuple: In instantiation of ‘constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >& std::get(const std::tuple<_Elements ...>&) [with long unsigned int __i = 0; _Elements = {glygraph::Edgecds::Residue, std::default_delete<glygraph::Edgecds::Residue >}; std::__tuple_element_t<__i, std::tuple<_Elements ...> > = glygraph::Edgecds::Residue]’:
/usr/include/c++/9/bits/unique_ptr.h:154:53: required from ‘std::__uniq_ptr_impl<_Tp, _Dp>::pointer std::__uniq_ptr_impl<_Tp, _Dp>::_M_ptr() const [with _Tp = glygraph::Edgecds::Residue; _Dp = std::default_delete<glygraph::Edgecds::Residue >; std::__uniq_ptr_impl<_Tp, _Dp>::pointer = glygraph::Edgecds::Residue]’
/usr/include/c++/9/bits/unique_ptr.h:361:28: required from ‘std::unique_ptr<_Tp, _Dp>::pointer std::unique_ptr<_Tp, _Dp>::get() const [with _Tp = glygraph::Edgecds::Residue; _Dp = std::default_delete<glygraph::Edgecds::Residue >; std::unique_ptr<_Tp, _Dp>::pointer = glygraph::Edgecds::Residue
]’
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/MolecularModeling/TemplateGraph/GraphStructure/include/Node.hpp:464:46: required from ‘void glygraph::Node::removeOutEdge(glygraph::Edge*) [with T = cds::Residue]’
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/MolecularModeling/TemplateGraph/GraphStructure/include/Node.hpp:178:9: required from ‘glygraph::Node::~Node() [with T = cds::Residue]’
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/includes/CentralDataStructure/residue.hpp:19:15: required from here
/usr/include/c++/9/tuple:1327:36: internal compiler error: Segmentation fault
1327 | { return std::__get_helper<__i>(__t); }

@gitoliver
Copy link
Contributor Author

In file included from /usr/include/c++/9/bits/stl_algobase.h:59,
from /usr/include/c++/9/vector:60,
from /home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/oligosaccharide.cc:4:
/usr/include/c++/9/bits/stl_multimap.h: In instantiation of ‘class std::multimap<std::__cxx11::basic_string, std::__cxx11::basic_string >’:
/home/oliver/Programs/GLYCAM_Dev_Env/V_2/Web_Programs/gems/gmml/src/Glycan/../../includes/MolecularModeling/../GeometryTopology/../MolecularModeling/oligosaccharidedetectionatom.hpp:101:34: required from here
/usr/include/c++/9/bits/stl_multimap.h:358:21: internal compiler error: Segmentation fault
358 | begin() const _GLIBCXX_NOEXCEPT
| ^~~~~~~~~~~~~~~~~
0x7fa48a91a08f ???
/build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7fa48a8fb082 __libc_start_main
../csu/libc-start.c:308
Please submit a full bug report,

@gitoliver
Copy link
Contributor Author

Again just recompiling will "fix" the compiler segfault, but this was an interesting one. First time I've seen it when compiling tests:
Testing 005.overlaps.cc... In file included from /usr/include/c++/8/bits/stl_algobase.h:61,
from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/string:40,
from /programs/gems/gmml/includes/common.hpp:4,
from /programs/gems/gmml/includes/gmml.hpp:4,
from tests/005.overlaps.cc:1:
/usr/include/c++/8/bits/cpp_type_traits.h: In instantiation of ‘_Iterator std::__miter_base(_Iterator) [with _Iterator = boost::token_iterator<boost::char_separator, __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string >, std::__cxx11::basic_string >]’:
/usr/include/c++/8/bits/stl_algobase.h:455:26: required from ‘_OI std::copy(_II, _II, _OI) [with _II = boost::token_iterator<boost::char_separator, __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string >, std::__cxx11::basic_string >; _OI = std::__cxx11::basic_string]’
/usr/include/c++/8/bits/vector.tcc:308:29: required from ‘void std::vector<_Tp, _Alloc>::_M_assign_aux(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = boost::token_iterator<boost::char_separator, __gnu_cxx::__normal_iterator<const char
, std::__cxx11::basic_string >, std::__cxx11::basic_string >; _Tp = std::__cxx11::basic_string; _Alloc = std::allocator<std::__cxx11::basic_string >]’
/usr/include/c++/8/bits/stl_vector.h:1512:4: required from ‘void std::vector<_Tp, _Alloc>::_M_assign_dispatch(_InputIterator, _InputIterator, std::__false_type) [with _InputIterator = boost::token_iterator<boost::char_separator, __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string >, std::__cxx11::basic_string >; _Tp = std::__cxx11::basic_string; _Alloc = std::allocator<std::__cxx11::basic_string >]’
/usr/include/c++/8/bits/stl_vector.h:656:4: required from ‘void std::vector<_Tp, _Alloc>::assign(_InputIterator, _InputIterator) [with _InputIterator = boost::token_iterator<boost::char_separator, __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string >, std::__cxx11::basic_string >; = void; _Tp = std::__cxx11::basic_string; _Alloc = std::allocator<std::__cxx11::basic_string >]’
/programs/gems/gmml/includes/utils.hpp:118:57: required from here
/usr/include/c++/8/bits/cpp_type_traits.h:420:20: internal compiler error: Segmentation fault
{ return __it; }
^
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-8/README.Bugs for instructions.
Test FAILED!
Exit Code: 1

This is the function it failed on. This is defined elsewhere with the same name so that could be it.

/*! \fn
  * Split a line (series of characters) with the given delimiter
  * @param line Input string in order to be split by the given delimiter
  * @param delim Series of delimiters (each delimiter character is followed by the next one in a single string variable) in order to split the given string
  * @return Vector of elements of the given string that have been split by the given delimiter(s)
  */
inline std::vector<std::string> Split(std::string line, std::string delim)
{
    boost::char_separator<char> separator(delim.c_str());
    boost::tokenizer< boost::char_separator<char> > tokens(line, separator);
    std::vector<std::string> vectorTokens = std::vector<std::string>();
    **vectorTokens.assign(tokens.begin(), tokens.end());**
    return vectorTokens;
}

Line 118 is bolded. Tho the origin could be just the crazy include cascade that comes from including gmml.hpp

@gitoliver
Copy link
Contributor Author

It's happening in the tests sometimes, again just recompiling and it's fine. Again it's gmml.hpp showing up:

webdev@oliver-gw-grpc-delegator:/programs/gems/gmml/tests$ bash compile_run_tests.bash -j10

#### Beginning GMML tests ####
Number of tests found:	25
Number of testing jobs:	10

mkdir: created directory './tempTestOutputs'

Beginning test: ./000.test.buildBySequenceOldWay.sh
Beginning test: ./002.test.createAssemblyWritePDB.sh
Beginning test: ./003.test.SuperimpositionEigen.sh
Beginning test: ./004.test.PDBpreprocessor.sh
Beginning test: ./005.test.Overlaps.sh
Beginning test: ./006.test.BFMP-RingShapeCalculation.sh
Beginning test: ./007.test.DetectSugars.sh
Beginning test: ./008.test.PDB2GlycamAndSubgraphMatching.sh
Beginning test: ./009.test.Reorder_and_Label_Sequence.sh
Beginning test: ./010.test.buildBySequenceRotamer.sh

Testing 009.reorderSequence.cc (Sequence reordering and labeling)... In file included from /programs/gems/gmml/includes/gmml.hpp:165,
                 from tests/009.reorderSequence.cc:1:
/programs/gems/gmml/includes/Resolver/PdbPreprocessor/pdbpreprocessor.hpp:471:9: internal compiler error: Segmentation fault
  471 |         }
      |         ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
Test FAILED! (comparison of results)
Exit Code: 1

Beginning test: ./011.test.writeResNumbers.sh

Testing 003.superimpositionEigen.cc... In file included from /programs/gems/gmml/includes/gmml.hpp:165,
                 from tests/003.superimpositionEigen.cc:1:
/programs/gems/gmml/includes/Resolver/PdbPreprocessor/pdbpreprocessor.hpp:471:9: internal compiler error: Segmentation fault
  471 |         }
      |         ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
Test FAILED!
Exit Code: 1

Beginning test: ./012.test.AddSolventNeutralize.sh

Testing 010.buildBySequenceRotamer.cc... Test FAILED! structure.pdb file different from tests/correct_outputs/010.buildBySequenceRotamer.pdb
Exit Code: 1

Beginning test: ./014.test.SequenceParser.sh

Testing 005.overlaps.cc... during GIMPLE pass: local-fnsummary
tests/005.overlaps.cc: In function ‘void __static_initialization_and_destruction_0(int, int)’:
tests/005.overlaps.cc:16:1: internal compiler error: Segmentation fault
   16 | }
      | ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
Test FAILED!
Exit Code: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant