Bug 99228 - Debugging PIEs does not work
Debugging PIEs does not work
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: gdb (Show other bugs)
rawhide
All Linux
high Severity high
: ---
: ---
Assigned To: Elena Zannoni
:
: 111183 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-07-16 05:04 EDT by Jakub Jelinek
Modified: 2007-11-30 17:10 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-09-02 10:18:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jakub Jelinek 2003-07-16 05:04:17 EDT
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 05:54:34 EST
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 12:56:51 EST
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 13:55:32 EST
*** Bug 111183 has been marked as a duplicate of this bug. ***
Comment 4 Elena Zannoni 2004-01-13 13:56:02 EST
this is next on my todo list. Stay tuned.
Comment 5 Joe Orton 2004-02-25 08:38:10 EST
We're still tuned in waiting for the show to start:)
Comment 6 Joe Orton 2004-04-18 07:43:42 EDT
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 10:18:02 EDT
Works here too.
Comment 8 John Flanagan 2004-12-21 14:36:54 EST
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.