I have a CentOS 6.10 with GCC 4.4.7 and Devtoolset 3, which has GCC 4.9.2.
Basically, I have this C++ project that runs perfectly fine when built using GCC 4.4.7 but results to a segmentation fault when built using GCC 4.9.2.
I checked the core file and it's simply pointing to this very simple condition:
if (value < this->value) { return; }
Also, when I comment-out that condition, a segmentation fault would still occur but would be pointing to a different part of the code. Adding the fact that it's working perfectly fine when built using GCC 4.4.7, I'm suspecting that the source code itself is not the problem but maybe something to do with the libraries linked to it.
I checked the shared library dependencies (using ldd) and it looks to be pointing to /usr/lib64/libstdc++.so.6, which is the old one. However, if I understood correctly the answer here, that's the expected behavior.
So, if the're nothing wrong with the source code and linking is also correct, is it something else that's causing the segmentation fault?