简体   繁体   English

GDB无法显示堆栈并显示“#1 0x0000000000000000 ?? ()”

[英]GDB cannot show the stack and shows “#1 0x0000000000000000 in ?? ()”

I have a multi-threaded C++ program that deadlocks in some rare cases. 我有一个多线程C ++程序,在一些罕见的情况下会死锁。 The problem is hard to reproduce and I can only reproduce it in a remote machine. 这个问题难以重现,我只能在远程机器上重现它。 The method I want to use for solving this problem is 我想用来解决这个问题的方法是

  1. run the program 运行程序
  2. wait for deadlock 等死锁
  3. send abort signal to it for generating core dump 向其发送中止信号以生成核心转储
  4. copy the dump back to my local machine 将转储复制回本地计算机
  5. use gdb to debug it 使用gdb来调试它

I do not have gdb on the remote machine and cannot install anything on it. 我在远程计算机上没有gdb,也无法在其上安装任何内容。 The problem is when I am debugging the core dump (obtained from either a dead-locked or normally running process on the remote machine), the back-trace of most of the threads show only: 问题是当我调试核心转储(从远程计算机上的死锁或正常运行的进程获得)时,大多数线程的反向跟踪仅显示:

(gdb) bt
#0  pthread_cond_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
#1  0x0000000000000000 in ?? ()

I am using a statically linked binary which is compiled with "-g -O1" options. 我使用静态链接二进制文件,使用“-g -O1”选项编译。 When I abort a process of the same binary on my local machine, gdb can extract the entire stack from core dump and there is no such problem (I cannot reproduce the deadlock however). 当我在本地机器上中止同一个二进制文件的进程时,gdb可以从核心转储中提取整个堆栈,并且没有这样的问题(但是我无法重现死锁)。 My remote machine is SLES and my local machine is ubuntu. 我的远程机器是SLES,我的本地机器是ubuntu。

Any idea? 任何的想法?

Edit: 编辑:

Found someone else with the same problem, but still with no solutions: http://groups.google.com/group/google-coredumper/browse_thread/thread/2ca9bcf9465d1050 (I am not using google coredumper, but it seems like google coredumper fails with the same error, this suggests that perhaps the problem is with SLES 11) 发现其他人有同样的问题,但仍然没有解决方案: http//groups.google.com/group/google-coredumper/browse_thread/thread/2ca9bcf9465d1050 (我没有使用谷歌coredumper,但似乎谷歌coredumper失败同样的错误,这表明问题可能与SLES 11)

Note that you can also use gcore to create a core file without aborting. 请注意,您还可以使用gcore创建核心文件而不会中止。 Have you tried running pstack on the remote host (assuming it's installed) to see if you can get a backtrace that way? 您是否尝试在远程主机上运行pstack(假设已安装)以查看是否可以通过这种方式获得回溯?

Otherwise, if the shared objects used by your application are different on your local host and remote host, gdb won't be able to match the memory offsets properly and the backtrace will probably get all confused. 否则,如果应用程序使用的共享对象在本地主机和远程主机上不同,gdb将无法正确匹配内存偏移量,并且回溯可能会让所有人感到困惑。 If you're able to copy all the relevant .so files from the remote host to some place locally I believe you can direct gdb to read from them instead of the normally installed versions. 如果您能够将所有相关的.so文件从远程主机复制到本地的某个位置,我相信您可以指示gdb从它们读取而不是正常安装的版本。

EDIT: try running pstack on your build machine and see if it can pick up a stack. 编辑:尝试在您的构建计算机上运行pstack,看看它是否可以获取堆栈。

What is the age of your glibc? 你的glibc的年龄是多少? Are you perhaps missing this: 你是否想念这个:

commit ad2be8527ac0f19f129fc4519d823cbe48239c78
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sun Apr 13 08:36:19 2003 +0000

    Update.

        * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
        * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
        * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 什么GDB回溯消息“0x0000000000000000 ?? ?? ()“ 意思? - What does the GDB backtrace message “0x0000000000000000 in ?? ()” mean? 为什么 gs 段寄存器地址在 visual studio x64(MASM) 上设置为 0x0000000000000000? - Why the gs segment register is address is set to 0x0000000000000000 on visual studio x64(MASM)? 通用顶点属性数组N使用的指针的值较小(0x0000000000000000)? - Generic vertex attribute array N uses a pointer with small value(0x0000000000000000)? Feature.exe:0xC0000005:访问冲突读取位置0x0000000000000000 - Feature.exe: 0xC0000005: Access violation reading location 0x0000000000000000 调用Isolate :: New()后访问冲突执行位置0x0000000000000000 - Access violation executing location 0x0000000000000000 after calling Isolate::New() GDB显示无堆栈 - GDB shows No stack 在“ 0x00007FFF168E1657(vcruntime140d.dll)”处引发异常 <name> .exe”:0xC0000005:访问冲突写入位置0x0000000000000000 - Exception thrown at 0x00007FFF168E1657 (vcruntime140d.dll) in “<name>.exe”: 0xC0000005: Access violation writing location 0x0000000000000000 gdb显示奇怪的堆栈跟踪 - gdb shows weird stack trace GDB 显示堆栈帧的函数参数不正确 - GDB shows incorrect arguments of functions for stack frames 访问冲突执行位置 0x0000000000000000。 OpenGL 带 GLAD 和 GLFW - Access violation executing location 0x0000000000000000. OpenGL with GLAD and GLFW
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM