开发者社区> 问答> 正文

gdb提示core file may not match specified executable file.

有两个程序A和B, 启动A后, A会fork()新线程然后使用execl()调用B程序

运行过程中B会出错产生core文件,使用gdb查看core文件时提示

warning: core file may not match specified executable file.
但是B文件明明是最新的.

请教这是为什么

补充完整的输出:

[service]$ sudo gdb ../xx/B core
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
http://bugs.launchpad.net/gdb-linaro/...
Reading symbols from /home/tizen/code/nsdlna/apps/player/ns-player...done.
[New LWP 1372]
[New LWP 1447]
[New LWP 1450]
[New LWP 1449]
[New LWP 1371]
[New LWP 1367]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Core was generated by `B'.
Program terminated with signal 11, Segmentation fault.
#0 malloc_consolidate (av=0xb5a00010) at malloc.c:4278
4278 malloc.c: No such file or directory.
warning: core file may not match specified executable file.
(gdb) bt
#0 malloc_consolidate (av=0xb5a00010) at malloc.c:4278
#1 malloc_consolidate (av=0xb5a00010) at malloc.c:4224
#2 0xb709a22f in _int_malloc (av=0xb5a00010, bytes=814) at malloc.c:3564
#3 0xb709cdec in __GI___libc_malloc (bytes=814) at malloc.c:2924
#4 0xb7297627 in operator new(unsigned int) () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#5 0xb729774b in operator new[](unsigned int) () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#6 0x080686a5 in ?? ()
#7 0x08067934 in ?? ()
#8 0x08067818 in ?? ()
#9 0x0806e7f7 in ?? ()
#10 0xb7424d4c in start_thread (arg=0xb657bb40) at pthread_create.c:308
#11 0xb7112bae in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
(gdb)

展开
收起
a123456678 2016-06-17 17:43:08 13347 0
1 条回答
写回答
取消 提交回答
  • 你可能理解错了core文件的用法。
    gdb调试core文件的命令如下:
    gdb execfilename corefiname
    第二个参数是可执行文件运行时挂掉产生的core文件的完整路径名,不是一个core关键字。

    2019-07-17 19:43:19
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
OPEN SOURCE 立即下载
OPEN SOURCE IN A DATA-DRIVEN WORLD 立即下载
Borgaonkar-New-Adventures-In-Spying-3G-And-4G-Users-Locate-Track-And-Monitor 立即下载