[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] [RFC][patch] Fix crash in _ULx86_64_tdep_trace whe

From: Paul Pluzhnikov
Subject: Re: [Libunwind-devel] [RFC][patch] Fix crash in _ULx86_64_tdep_trace when sigaltstack is too far away
Date: Mon, 14 Nov 2011 17:02:40 -0800

On Fri, Nov 11, 2011 at 1:41 PM, Lassi Tuura <address@hidden> wrote:

> Yes, you are right, I noticed the same. But we probably shouldn't store
> the difference to the original stack but to the ucontext_t which should
> be in nearby offset, on the signal stack.

In fact, AFAICT for Linux ucontext_t is the very last thing copied onto
the stack before invoking the signal handler. That is, when signal handler
start running, the stack layout is:

  ... higher addresses ...
         __restore_rt (== pretcode in rt_sigframe from
  SP ->
        ... sighandler runs on this stack.

  ... lower addresses ...

This makes it very convenient to find ucontext from the CFA.

Attached patch re-tested on Linux/x86_64, no new failures.


P.S. test-setjmp is failing for me (before or after the patch).
When I enable assertions (to confirm my new assertions are correct), I see:

  lt-test-setjmp: ../../src/dwarf/Gparser.c:754: apply_reg_state: \
    Assertion `rs->reg[17].where == DWARF_WHERE_EXPR' failed.

which likely explains that failure.

Paul Pluzhnikov

Attachment: libunwind-crash-in-fasttrace-20111114.txt
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]