Code doesnt work in fedora but works fine in ubuntu?

I just installed root in my fedora34 and got some big code from my boss. all code works fine in Ubuntu (root 6.20) but when i run them, there are many error like some header files not included(i solved them) but again i get something like:

SignalExtraction("…/pl/2021.05.06_0001")
Saving to file: …/pl/2021.05.06_0001.root
/usr/include/c++/11/bits/stl_vector.h:1045: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = double; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::ref
erence = double&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion ‘__n < this->size()’ failed.

and root get quit by itself?

while running root i also get something like:
Info in TUnixSystem::ACLiC: creating shared library /run/media/dpk/DATA/code/SignalExtraction_cpp.so
Warning in cling::IncrementalParser::CheckABICompatibility():
Possible C++ standard library mismatch, compiled with GLIBCXX ‘20210210’
Extraction of runtime standard library version was: ‘20210428’

Can this be the cause of everything?

ROOT Version: 6.22
Platform: Fedora
Compiler: gcc 11.1

Where did you get your ROOT build from?

/usr/include/c++/11/bits/stl_vector.h:1045: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = double; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::ref erence = double&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion ‘__n < this->size()’ failed. means your boss’s code has a problem :slight_smile: You can debug with gdb and .x SignalExtraction.cpp++g (the two pluses mean “rebuild!” and the “g” means “with debug info”). gdb will stop at the assert and you can look at the backtrace to see where the wrong access into the vector<double> happens. Or you need to share the code with us in a way that allows us to reproduce this (i.e. run the code and get the same error) so we can debug.

I got my ROOT by : sudo yum install root

Thanks for reply and saving me from wasting my efforts. Indeed, it was a problem with boss code. I solved it in 10 min (after reading your reply). Thanks for the guidance.

1 Like