Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 56270 - gdb fails to debug a program linked with ld-linux.so.2
gdb fails to debug a program linked with ld-linux.so.2
Product: Red Hat Linux
Classification: Retired
Component: gdb (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
Depends On:
  Show dependency treegraph
Reported: 2001-11-14 15:16 EST by Oliver Beckstein
Modified: 2007-04-18 12:38 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-11-28 19:07:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Oliver Beckstein 2001-11-14 15:16:31 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.9-12custom i686)

Description of problem:
gdb does not allow to debug a simple program (helloworld.c). It stops with
a SIGTRAP, presumably in ld-linux.so and on 'cont' drops me into a sub
shell. Returning with exit to gdb, I find my program 'finished' (according
to gdb) but I cannot examine it.

Ignoring SIGTRAP in gdb ('handle SIGTRAP nopass') simply terminates my

gdb behaves properly on a variety of systems with glibc 2.1.3 (instead of
2.2.4-19 as on this system).

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.cat >hoo.c <<EOF
#include <strings.h>
int main () { printf("Hello Universe!\n");  return 0; };
2. gcc -o hoo hoo.c
3. gdb hoo
4. [gdb] run
Additionally, check dynamic linking:
   ldd ./hoo
Program works:

Actual Results:  3. GNU gdb 5.0rh-5 Red Hat Linux 7.1
4. (gdb) run
Starting program: /sansom/kir/oliver/tmp/hw/hoo 

Program received signal SIGTRAP, Trace/breakpoint trap.
0x15557e90 in ?? ()
(gdb) cont
oliver@homer [oliver/tmp/hw]> logout
bash: logout: not login shell: use `exit'
oliver@homer [oliver/tmp/hw]> exit

Program exited normally.

Linking: ldd hoo
 	libc.so.6 => /lib/i686/libc.so.6 (0x1557c000)
	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x15556000)
Program runs as expected:
Hello Universe!

Expected Results:  gdb should have run the program without getting a
SIGTRAP, printing Hello Universe!, and it should have also allowed me to
set break points and examine the program.

Additional info:

Detailed versions:

System: Linux RedHat 7.1
Kernel: 2.4.9-12custom   (from RH)

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)

/lib/ld-linux.so -> ld-2.2.4.so 
in rpm: glibc 2.2.4-19

  GNU gdb 5.0rh-5 Red Hat Linux 7.1
  This GDB was configured as "i386-redhat-linux".

in rpm:  gdb-5.0rh-5
and also with a freshly compiled

  GNU gdb 2001-11-14-cvs
Comment 1 Jakub Jelinek 2001-11-28 05:22:10 EST
Works for me. No matter what, this is a gdb report, not ld.so, so reassigning.
Comment 2 Trond Eivind Glomsrxd 2001-11-28 19:06:57 EST
Couldn't reproduce, it worked fine here. If you're still experiencing the
problem, please give gdb 5.1 from rawhide a try (do a "rpm --rebuild" of the
SRPM if necesarry).
Comment 3 Richard 2004-10-27 06:10:26 EDT
I get the same problem.
Can't even get a simple hello world to debug in KDevelop.
using DDD somehow works fine as it skip the error from gdb.

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