linux - gdb提示core file may not match specified executable file.
伊谢尔伦
伊谢尔伦 2017-04-17 11:42:41
0
1
2021

有两个程序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)

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

全部回覆(1)
大家讲道理

你可能理解錯了core檔的用法。
gdb調試core檔案的命令如下:
gdb execfilename corefiname
第二個參數是可執行檔執行階段掛掉產生的core檔的完整路徑名,不是一個core關鍵字。

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板