Bug 99228 - Debugging PIEs does not work
Summary: Debugging PIEs does not work
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: rawhide
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Elena Zannoni
QA Contact:
URL:
Whiteboard:
: 111183 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-07-16 09:04 UTC by Jakub Jelinek
Modified: 2007-11-30 22:10 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-09-02 14:18:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2004:561 0 normal SHIPPED_LIVE Updated gdb and libunwind packages 2004-12-21 05:00:00 UTC

Description Jakub Jelinek 2003-07-16 09:04:17 UTC
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)

Comment 1 Joe Orton 2003-11-26 10:54:34 UTC
Any ETA on this?  Since more and more of our binaries are built as
PIEs this bug becomes increasingly annoying...

Comment 2 Nathan Bryant 2004-01-13 17:56:51 UTC
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)

Comment 3 Elena Zannoni 2004-01-13 18:55:32 UTC
*** Bug 111183 has been marked as a duplicate of this bug. ***

Comment 4 Elena Zannoni 2004-01-13 18:56:02 UTC
this is next on my todo list. Stay tuned.

Comment 5 Joe Orton 2004-02-25 13:38:10 UTC
We're still tuned in waiting for the show to start:)

Comment 6 Joe Orton 2004-04-18 11:43:42 UTC
I'm able to get backtraces out of core dumps produced by PIE
executables using gdb-6.0post-0.20040223.8.  Thanks!

Comment 7 Tim Waugh 2004-09-02 14:18:02 UTC
Works here too.

Comment 8 John Flanagan 2004-12-21 19:36:54 UTC
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



Note You need to log in before you can comment on or make changes to this bug.