Bug 78675 - Backtraces should work across sighandler boundary, even with alternative stacks
Backtraces should work across sighandler boundary, even with alternative stacks
Status: CLOSED DEFERRED
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: gdb (Show other bugs)
2.1
ia64 Linux
medium Severity low
: ---
: ---
Assigned To: Elena Zannoni
Jay Turner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-11-27 10:40 EST by Johan Walles
Modified: 2015-01-07 19:01 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-01-16 09:38:28 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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 10:42 EST, Johan Walles
no flags Details

  None (edit)
Description Johan Walles 2002-11-27 10:40:37 EST
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 10:42:24 EST
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 06:54:49 EST
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 09:38:28 EST
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.