unable to get backtrace
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)
-Thomas
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu gdb Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask tom anderson for more information if necessary.