I have a small project in C ++ for Linux. When I try to debug the executable using gdb, I get the following error:
../../gdb/dwarf2read.c:16760: internal-error: follow_die_offset: Assertion 'dwarf2_per_objfile->reading_partial_symbols' failed. A problem internal to GDB has been detected, further debugging may prove unreliable.
I greatly simplified the project to the following code and still get the same error:
Bh:
#ifndef B_H_ #define B_H_ #include <vector> class B { public: B(); std::vector<double> p; }; #endif
B.cpp:
#include "Bh" B::B() {}
Dh:
#ifndef D_H_ #define D_H_ #include "Eh" class D: public E { public: D(); }; #endif
D.cpp:
#include "Dh" D::D() : E() {}
Eh:
#ifndef E_H_ #define E_H_ #include <functional> class E { public: void set(const std::function<double(void)>& f); std::function<double(void)> e; }; #endif
E.cpp:
#include "Eh" void E::set(const std::function<double(void)>& f) { e = f; }
main.cpp:
int main() {}
Makefile:
all: Test %.o: %.cpp icpc -c -std=c++11 -g -o $@ $< Test: main.o Do Eo Bo icpc -std=c++11 -o $@ $^ clean: rm -f Do Eo Bo Test main.o .PHONY: all clean
An error occurs if I do:
gdb Test
and then call
run
in the gdb CLI.
My system:
Open Suse 12.3, 64bit
icpc -version:
icpc (ICC) 15.0.1 20141023
icpc -v:
icpc version 15.0.1 (gcc version 4.7.0 compatibility)
gdb --version:
GNU gdb (GDB) SUSE (7.5.1-2.1.1)
gcc --version:
gcc (SUSE Linux) 4.7.2 20130108 [gcc-4_7-branch revision 195012]
I do not know what is wrong with this code and why the debugger crashes. For example, if I comment on the constructor of class B (which does nothing and should be equivalent to the default constructor), the error no longer appears.
source share