c++ - GDB 在启动时崩溃(内部错误 : follow_die_offset)

标签 c++ linux gdb

我在 Linux 下有一个小的 C++ 项目。当我尝试使用 gdb 调试可执行文件时,出现以下错误:

../../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.

我已将项目大力简化为以下代码,但仍然出现相同的错误:

B.h:

#ifndef B_H_
#define B_H_

#include <vector>
class B {
public:
    B();
    std::vector<double> p;
};

#endif /* B_H_ */

B.cpp:

#include "B.h"
B::B() {}

D.h:

#ifndef D_H_
#define D_H_

#include "E.h"

class D: public E {
public:
    D();
};

#endif /* D_H_ */

D.cpp:

#include "D.h"

D::D() : E() {}

E.h:

#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_H_ */

E.cpp:

#include "E.h"

void E::set(const std::function<double(void)>& f) {
    e = f;
}

主要.cpp:

int main() {}

生成文件:

all: Test

%.o: %.cpp
    icpc -c -std=c++11 -g -o $@ $<

Test: main.o D.o E.o B.o
    icpc -std=c++11  -o $@ $^

clean: 
    rm -f D.o E.o B.o Test main.o

.PHONY: all clean 

如果我这样做会发生错误:

gdb Test

然后调用

run

在 gdb CLI 中。

我的系统:

打开 Suse 12.3,64 位

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]

我不知道给定代码有什么问题以及调试器崩溃的原因。例如,如果我注释掉 B 类的构造函数(它什么都不做,应该等同于默认构造函数),错误就不会再出现。

最佳答案

查看此线程:https://software.intel.com/en-us/forums/topic/540685 -- 这似乎是 gdb 中的一个问题,已在 7.9 中修复。 更新 我将 gdb 升级到 7.9,问题真的消失了,至少对我来说是这样。

关于c++ - GDB 在启动时崩溃(内部错误 : follow_die_offset),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27355304/

相关文章:

Android NDK - 没有这样的文件或目录编译终止 - 头文件导出问题

python - authGSSServerInit 极慢

debugging - gdb:寄存器值为 0xffaa 时的断点

c++ - 按名称或签名计算函数调用。海合会,C++

c - GDB 单步执行汇编并显示下一条将要执行的指令。

c++ - boost 进程间内存分配缓慢

c++ - 透视正确的纹理贴图; z距离计算可能错误

c++ - Visual Studio 上的 AWS C++ SDK 链接器错误

linux - 在后台运行 iperf 并将输出重定向到文件

python - 使用 Python 在 linux 终端中显示图像