Bug 130254 - glibc's traceback() fails when called from an exception handler
Summary: glibc's traceback() fails when called from an exception handler
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: glibc
Version: 3.0
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-08-18 15:22 UTC by Ed Connell
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-12-20 18:14:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
C program that fails on ia64 (744 bytes, text/plain)
2004-08-18 15:24 UTC, Ed Connell
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2004:586 0 normal SHIPPED_LIVE Low: glibc security update 2004-12-20 05:00:00 UTC

Description Ed Connell 2004-08-18 15:22:59 UTC
Description of problem:
On ia64, traceback() works fine generally but causes recursive SEGV's 
when called from an exception handler.  On x86 both cases work fine.  
The bug can be observed with a small testcase or with a trivial 
testcase and the /usr/bin/catchsegv script.  I will attach the small 
testcase but include the trivial testcase inline here.

[edconn@order ~/traceppen]$ cat segv.c
int main()
{
  int *ip = (int *)0;
  *ip = 0;

  return 0;
}

[edconn@order ~/traceppen]$ gcc -o segv segv.c -rdynamic -g -funwind-
tables

[edconn@order ~/traceppen]$ catchsegv ./segv
*** Segmentation fault

Backtrace:
*** Segmentation fault
 .
 .
 .


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

How reproducible:
Every time.

Steps to Reproduce:
1. gcc -o toy toy.c -rdynamic -g -funwind-tables
2. ./toy
  
Actual results:
[edconn@order ~/traceppen]$ ./toy 
Caught SEGV. Code is 2.
Caught SEGV. Code is 1.
Caught SEGV. Code is 1.
Caught SEGV. Code is 1.
Caught SEGV. Code is 1.
Caught SEGV. Code is 1.
./toy(print_trace+0x40) [0x4000000000000f20]
./toy(segv_hand+0xa0) [0x4000000000000ec0]
[0xa0000000000040c0]
/lib/libgcc_s.so.1 [0x20000000002fda41]
/lib/libgcc_s.so.1 [0x20000000002fdf20]
/lib/libgcc_s.so.1(_Unwind_Backtrace+0x300) [0x20000000002ffc30]
/lib/tls/libc.so.6.1(backtrace+0x110) [0x200000000023f700]
./toy(print_trace+0x40) [0x4000000000000f20]
./toy(segv_hand+0xa0) [0x4000000000000ec0]
[0xa0000000000040c0]
/lib/libgcc_s.so.1 [0x20000000002fda41]
/lib/libgcc_s.so.1 [0x20000000002fdf20]
 .
 .
 .


Expected results:
edconn@chaos% ./toy 
Caught SEGV. Code is 1.
./toy(print_trace+0x1a) [0x80486e2]
./toy(segv_hand+0x21) [0x80486bd]
./toy [0x42028c40]
./toy(__libc_start_main+0xa4) [0x420158d4]
./toy(backtrace_symbols+0x31) [0x804860d]


Additional info:

Comment 1 Ed Connell 2004-08-18 15:24:18 UTC
Created attachment 102843 [details]
C program that fails on ia64

Comment 2 Jakub Jelinek 2004-10-08 11:41:29 UTC
gcc -g -o toy toy.c -Wl,--export-dynamic; ./toy; echo $?; rpm -q gcc glibc libgcc
Caught SEGV. Code is 2.
./toy(print_trace+0x40) [0x4000000000000f00]
./toy(segv_hand+0xa0) [0x4000000000000ea0]
[0xa0000000000040c0]
./toy(main+0xc1) [0x4000000000001151]
/lib/tls/libc.so.6.1(__libc_start_main+0x440) [0x200000000007e990]
./toy(_start+0x80) [0x4000000000000c80]

0
gcc-3.2.3-43
glibc-2.3.2-95.28
libgcc-3.2.3-43

catchsegv is still broken on IA-64, it doesn't use backtrace() internally
(but it should).

Comment 3 Jakub Jelinek 2004-10-15 05:19:10 UTC
catchseg should be fixed in rawhide glibc, eventually will be backported
to RHEL3 glibc too.

Comment 4 Jakub Jelinek 2004-10-22 17:43:02 UTC
catchsegv fixed in glibc-2.3.2-95.30.

Comment 5 John Flanagan 2004-12-20 18:14:19 UTC
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.

http://rhn.redhat.com/errata/RHSA-2004-586.html



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