cat > test.c <<EOF #include <stdio.h> int main (void) { puts ("Hello, world!"); return 0; } EOF gcc -g -o test test.c -pie -fpie gdb ./test GNU gdb Red Hat Linux (5.3post-1.20021129.37rh) Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu"... (gdb) b main Breakpoint 1 at 0xd14: file test.c, line 4. (gdb) r Keeping /tmp/test... Starting program: /tmp/test Warning: Cannot insert breakpoint 1. Error accessing memory address 0xd14: Input/output error. (gdb)
Any ETA on this? Since more and more of our binaries are built as PIEs this bug becomes increasingly annoying...
Besides breakpoints, symbol table mapping doesn't work, either: [nbryant@lasn-001 nbryant]$ cat test.c #include <time.h> int main(void) { struct timespec t = {60, 0}; nanosleep(&t, NULL); return 0; } [nbryant@lasn-001 nbryant]$ gcc -pie -fpie -o test test.c [nbryant@lasn-001 nbryant]$ ./test & [1] 4856 [nbryant@lasn-001 nbryant]$ gdb ./test 4856 GNU gdb Red Hat Linux (5.3.90-0.20030710.41rh) Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"...(no debugging symbols found)...Using host libthread_db library "/lib/tls/libthread_db.so.1". Attaching to program: /home/nbryant/test, process 4856 0x0077bc32 in ?? () (gdb) bt #0 0x0077bc32 in ?? () #1 0x00508560 in ?? () #2 0x00390861 in ?? () #3 0xbfe72288 in ?? () (gdb) quit The program is running. Quit anyway (and detach it)? (y or n) y Detaching from program: /home/nbryant/test, process 4856 [1]+ Done ./test [nbryant@lasn-001 nbryant]$ gcc -o test test.c [nbryant@lasn-001 nbryant]$ ./test & [1] 4863 [nbryant@lasn-001 nbryant]$ gdb ./test 4863 GNU gdb Red Hat Linux (5.3.90-0.20030710.41rh) Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"...(no debugging symbols found)...Using host libthread_db library "/lib/tls/libthread_db.so.1". Attaching to program: /home/nbryant/test, process 4863 Reading symbols from /lib/tls/libc.so.6...(no debugging symbols found)...done. Loaded symbols for /lib/tls/libc.so.6 Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/ld-linux.so.2 0x00fbac32 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 (gdb) bt #0 0x00fbac32 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 #1 0x0036c560 in __nanosleep_nocancel () from /lib/tls/libc.so.6 #2 0x08048378 in main () (gdb)
*** Bug 111183 has been marked as a duplicate of this bug. ***
this is next on my todo list. Stay tuned.
We're still tuned in waiting for the show to start:)
I'm able to get backtraces out of core dumps produced by PIE executables using gdb-6.0post-0.20040223.8. Thanks!
Works here too.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2004-561.html