Bug 90402 - backtrace() is broken
backtrace() is broken
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: glibc (Show other bugs)
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2003-05-07 13:54 EDT by Johan Walles
Modified: 2007-11-30 17:06 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-11-14 10:14:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
backtrace() example program from the info documentation (658 bytes, text/plain)
2003-05-07 13:55 EDT, Johan Walles
no flags Details

  None (edit)
Description Johan Walles 2003-05-07 13:54:16 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210

Description of problem:
Building and compiling the example program from the info documentation doesn'd
produce any backtrace.

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

How reproducible:

Steps to Reproduce:
1. Build the backtrace() example program from the info documentation
2. Run it

Actual Results:  (nil): [(nil)]

Expected Results:  I should have gotten a non-nil backtrace of the example program.

Additional info:

Will attach a copy of the example program.
Comment 1 Johan Walles 2003-05-07 13:55:31 EDT
Created attachment 91534 [details]
backtrace() example program from the info documentation

I modified the program slightly to print the address of each function in
addition to the function itself.
Comment 2 Jakub Jelinek 2003-10-03 07:07:57 EDT
Works for me just fine:
$ gcc -g -o test test.c
$ ./test
Obtained 5 stack frames.
0x8048534: ./test(backtrace_symbols+0x124) [0x8048534]
0x80485cb: ./test(backtrace_symbols+0x1bb) [0x80485cb]
0x80485db: ./test(backtrace_symbols+0x1cb) [0x80485db]
0xb74b5687: /lib/i686/libc.so.6(__libc_start_main+0x93) [0xb74b5687]
0x8048441: ./test(backtrace_symbols+0x31) [0x8048441]
$ ./test
$ rpm -q glibc
$ gcc -g -o test test.c -Wl,--export-dynamic
$ ./test
Obtained 5 stack frames.
0x8048734: ./test(print_trace+0x14) [0x8048734]
0x80487cb: ./test(dummy_function+0xb) [0x80487cb]
0x80487db: ./test(main+0xb) [0x80487db]
0xb74b5687: /lib/i686/libc.so.6(__libc_start_main+0x93) [0xb74b5687]
0x8048641: ./test(backtrace_symbols+0x3d) [0x8048641]

(you need --export-dynamic if you want to see the symbols in the binary).
Comment 3 Johan Walles 2003-10-03 07:22:36 EDT
This was filed on ia64.  Your example shows 32-bit addresses.

Could you try this on ia64?
Comment 4 Jakub Jelinek 2003-10-03 09:28:46 EDT
Oops, sorry, missed that.
(not AS2.1 material though, needs GCC 3.2.3-rh or 3.3.1 and later).
Comment 5 Jakub Jelinek 2003-11-14 10:14:00 EST
An errata 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.


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