gcore produces core file without backtrace capability
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gdb (Ubuntu) |
Fix Released
|
Low
|
Kees Cook | ||
Lucid |
Won't Fix
|
Low
|
Kees Cook | ||
Maverick |
Fix Released
|
Low
|
Kees Cook | ||
Natty |
Fix Released
|
Low
|
Kees Cook |
Bug Description
Binary package hint: gdb
I am unable to get a meaningful backtrace after loading a core file. I do the following
1. compile singlethread2.c
2. ./singlethread2
3. gdb singlethread2
4. attach <pid>
5. gcore
6. gdb singlethread2 <core>
details below:
=======
g++ -Wall -g -D REEENTRANT -o singlethread2.g singlethread2.c
=======
sh-3.00$ cat singlethread2.c
#include <stdio.h>
#include <stdlib.h>
int x = 0;
int main(void) {
while(1) {
x++;
printf("X is now %d.\n", x);
}
return(1);
}
=======
0 %> gdb singlethread2.g
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
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 "x86_64-
(gdb) attach 11575
Attaching to program: /import/
Reading symbols from /usr/lib/
Loaded symbols for /usr/lib/
Reading symbols from /lib/libm.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libgcc_
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libc.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-
Loaded symbols for /lib64/
0x00007fc8881e1fc0 in write () from /lib/libc.so.6
(gdb) bt
#0 0x00007fc8881e1fc0 in write () from /lib/libc.so.6
#1 0x00007fc88817d87a in _IO_file_write () from /lib/libc.so.6
#2 0x00007fc88817e759 in _IO_do_write () from /lib/libc.so.6
#3 0x00007fc88817d4e9 in _IO_file_xsputn () from /lib/libc.so.6
#4 0x00007fc88814ffb3 in vfprintf () from /lib/libc.so.6
#5 0x00007fc888159eca in printf () from /lib/libc.so.6
#6 0x0000000000400614 in main () at singlethread2.c:7
(gdb) gcore core.singlethea
Saved corefile core.singlethea
=======
0 %> gdb singlethread2.g core.singlethea
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
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 "x86_64-
Core was generated by `/import/
[New process 11575]
#0 0x00007fc8881e1fc0 in ?? ()
(gdb) bt
#0 0x00007fc8881e1fc0 in ?? ()
#1 0x00007fc88817d87a in ?? ()
#2 0x0000000000000000 in ?? ()
(gdb)
I have tried this on fedora 14 and it works properly. Why doesnt this work on ubunut? I tried on ubuntu 8.1, 9.04 and 10.10. It doesn't work on any of those ubuntu desktop releases.
Here is the output from fedora 14
[root@fedora14 ~]# gdb singlethread2.g core.10244
GNU gdb (GDB) Fedora (7.2-23.fc14)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
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-redhat-
For bug reporting instructions, please see:
<http://
Reading symbols from /root/singlethr
[New Thread 10244]
Missing separate debuginfo for
Try: yum --disablerepo='*' --enablerepo=
Reading symbols from /lib/libc.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-
Loaded symbols for /lib/ld-linux.so.2
Core was generated by `./singlethread
#0 0x005b1416 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install glibc-2.
(gdb) info share
From To Syms Read Shared Object Library
0x00e5bbf0 0x00f7e1d4 Yes (*) /lib/libc.so.6
0x00a18850 0x00a30e2f Yes (*) /lib/ld-linux.so.2
(*): Shared library is missing debugging information.
(gdb) bt
#0 0x005b1416 in __kernel_vsyscall ()
#1 0x00f111e3 in __write_nocancel () from /lib/libc.so.6
#2 0x00eb03ac in _IO_new_file_write () from /lib/libc.so.6
#3 0x00eaffff in new_do_write () from /lib/libc.so.6
#4 0x00eb193e in _IO_new_do_write () from /lib/libc.so.6
#5 0x00eb1c7a in _IO_new_
#6 0x00eb0145 in _IO_new_file_xsputn () from /lib/libc.so.6
#7 0x00e85d7a in vfprintf () from /lib/libc.so.6
#8 0x00e900a0 in printf () from /lib/libc.so.6
#9 0x080483f1 in main () at singlethread2.c:7
(gdb)
I have also tried this on the latest debian and it works. Here is the output from debian
debian:
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
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 "i486-linux-gnu"...
warning: Can't read pathname for load map: Input/output error.
Reading symbols from /usr/lib/
Loaded symbols for /usr/lib/
Reading symbols from /lib/i686/
Loaded symbols for /lib/i686/
Reading symbols from /lib/libgcc_
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/i686/
Loaded symbols for /lib/i686/
Reading symbols from /lib/ld-
[New process 3008]
#0 0xb7710416 in __kernel_vsyscall ()
(gdb) bt
#0 0xb7710416 in __kernel_vsyscall ()
#1 0xb75553a3 in write () from /lib/i686/
#2 0xb74eeeac in _IO_file_write () from /lib/i686/
#3 0xb74f0027 in _IO_do_write () from /lib/i686/
#4 0xb74efa00 in _IO_file_overflow () from /lib/i686/
#5 0xb74eeb15 in _IO_file_xsputn () from /lib/i686/
#6 0xb74c4c97 in vfprintf () from /lib/i686/
#7 0xb74ce4e0 in printf () from /lib/i686/
#8 0x080484b7 in main () at singlethread2.c:8
(gdb)
install@debian:~$ cat /proc/version
Linux version 2.6.26-2-686 (Debian 2.6.26-25lenny1) (<email address hidden>) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Thu Sep 16 19:35:51 UTC 2010
install@debian:~$ cat /etc/issue
Debian GNU/Linux 5.0 \n \l
install@debian:~$
Changed in gdb (Ubuntu Natty): | |
assignee: | nobody → Kees Cook (kees) |
status: | New → Fix Committed |
Changed in gdb (Ubuntu Maverick): | |
status: | New → Confirmed |
Changed in gdb (Ubuntu Natty): | |
importance: | Undecided → Low |
Changed in gdb (Ubuntu Maverick): | |
importance: | Undecided → Low |
Changed in gdb (Ubuntu Lucid): | |
importance: | Undecided → Low |
Changed in gdb (Ubuntu Maverick): | |
status: | Confirmed → Fix Committed |
Changed in gdb (Ubuntu Lucid): | |
status: | Confirmed → In Progress |
Changed in gdb (Ubuntu Maverick): | |
assignee: | nobody → Kees Cook (kees) |
Changed in gdb (Ubuntu Lucid): | |
assignee: | nobody → Kees Cook (kees) |
On Tue, Nov 23, 2010 at 06:30:23PM -0000, tom anderson wrote:
> 0 %> gdb singlethread2.g
> GNU gdb 6.8-debian
Fails (Ubuntu gdb 6.8)
> [root@fedora14 ~]# gdb singlethread2.g core.10244
> GNU gdb (GDB) Fedora (7.2-23.fc14)
Works (Fedora gdb 7.2)
> debian: /home/install# gdb ./singlethread2.g core.3008
> GNU gdb 6.8-debian
Works (Debian gdb 6.8)
Have you tried Debian unstable's 7.2 gdb yet? The Ubuntu and Debian versions are
almost identical there. Debian and Ubuntu's 6.8 gdbs have some large differences.
Fedora and Debian's 7.2 gdb are pretty different as well, since Fedora carries a
large patchset that they haven't pushed upstream yet. I would assume that whatever
was working in a relatively stock gdb 6.8 regressed in 7.2, but Fedora may have
patched it to work again.
I would start by looking through the Fedora patches for gdb 7.2 and try applying them
until the fix is found.
-Kees
--
Kees Cook
Ubuntu Security Team