libunwind-devel
[Top][All Lists]
Advanced

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

[Libunwind-devel] unw_init_local() with a signal frame context.


From: Tim Deegan
Subject: [Libunwind-devel] unw_init_local() with a signal frame context.
Date: Sat, 20 Dec 2014 15:18:16 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

Hi all,

While looking into a report about problems with libunwind unwinding
from __lll_unlock_wake(), I noticed that I was getting some traces
that didn't unwind at all, from one particular address in
__lll_unlock_wake().

On closer inspection, the one IP that fails is the first instruction
in the function, and the failure is that c->use_pre_instr is set,
causing the unwinder to look up the byte just before the function.

I'm getting these traces from libprofiler/gperftools, which gets hold
of the interrupted context in its signal handler (as a ucontext_t *)
and passes it to unw_init_local() as its second argument.
unw_init_local() unconditionally sets use_pre_instr, which is correct
if the context came from unw_getcontext(), but not in this case.

Disabling this path in libprofiler (and switching to a slower one that
calls unw_getcontext() and then discards the first few frames) fixes
the problem.

Arguably this bug is in libprofiler, which ought not to be just
passing a ucontext_t * to unw_init_local (though I see that the man
page suggests this is OK for IA-64 at least).  But even so it would be
good if libprofiler could use the signal context it already has,
without setting use_prev_instr.

Any ideas?  I'm happy to code / test things if someone who understands
this code properly can point me in the right direction. :)

Cheers,

Tim.

-- 
                                         Tim Deegan <address@hidden>
          These symptoms -- so familiar at this time of year -- can mean
               only one thing: Tiny fanged snails are eating your brain.
                            [ Dave Barry, "The Miami Herald", 16/11/03 ]



reply via email to

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