Bug 78675 - Backtraces should work across sighandler boundary, even with alternative stacks
Summary: Backtraces should work across sighandler boundary, even with alternative stacks
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: gdb
Version: 2.1
Hardware: ia64
OS: Linux
medium
low
Target Milestone: ---
Assignee: Elena Zannoni
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-11-27 15:40 UTC by Johan Walles
Modified: 2015-01-08 00:01 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-01-16 14:38:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Demo program. Break in "handler" and do "bt" there. The main() function doesn't appear in the backtrace. (772 bytes, text/plain)
2002-11-27 15:42 UTC, Johan Walles
no flags Details

Description Johan Walles 2002-11-27 15:40:37 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827

Description of problem:
When debugging a program that uses an alternative stack (do man sigaltstack),
doing "bt" inside a signal handler should show me the stack frames before the
handler was called.

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


How reproducible:
Always

Steps to Reproduce:
Debug a program that uses an alternative stack for signal handling.  Put a
breakpoint inside a signal handler and pass the appropriate signal to the
program.  When you've stopped at the breakpoint, do "bt".

Actual Results:  Stack frames are shown, but only on this side of the call to
the signal handler.  What the program was doing when the signal was received is
impossible to tell from the backtrace.

Expected Results:  All stack frames, even the ones on the ordinary stack, should
have been shown.  Then I could tell just from doing "bt" what the program was
doing when the signal arrived.

Additional info:

Will upload a test program demonstrating the problem.  Note that this works fine
on IA32.

Comment 1 Johan Walles 2002-11-27 15:42:24 UTC
Created attachment 86724 [details]
Demo program.  Break in "handler" and do "bt" there.  The main() function doesn't appear in the backtrace.

Comment 2 Johan Walles 2003-01-16 11:54:49 UTC
Apparently Mosberger has already solved this problem using his libunwind.  Both
libunwind and a patch to gdb to make it use libunwind are available at
"ftp://ftp.hpl.hp.com/pub/linux-ia64/".  Haven't tried them yet, but they are
rumored to resolve this problem.


Comment 3 Johan Walles 2003-01-16 14:38:28 UTC
They do resolve the problem in the general case.  However, in its current
incarnation this behaves even worse than gdb proper when dealing with our
dynamically generated code (I'm not blaming them...), and thus this doesn't
resolve our original problem.  So while this patched version of gdb is probably
the way to go, from our point of view it is not there yet.

Unforturnately I don't think this is anything you guys can do anything about, so
I'm closing this.  If you want to fix this for any of your other customers, feel
free to re-open.


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