libunwind-devel
[Top][All Lists]
Advanced

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

[libunwind] endless backtrace


From: Richard C Bilson
Subject: [libunwind] endless backtrace
Date: Thu, 18 Nov 2004 14:39:50 -0500 (EST)

I've been noticing strange behavior with relatively simple local
unwinding.  Sometimes my attempts to construct a backtrace will result
in endless cycling at the bottom of the stack.  Typically, my code
traces down to the bottom of the stack (to a function such as
__do_global_ctors_aux) using unw_step, but rather than unw_step
returning 0 it returns a positive value, causing my code to keep
looping, revisiting the same frame over and over.

Obviously, I could put a hack in to detect this and stop looping, but
I'd rather find some piece of code to blame and hopefully fix.  I'm
doing this on an Itanium-2 Debian unstable system (i.e. gcc 3.3.5,
glibc 2.3.2).  I've tried both the system libunwind and versions of
0.98.1 and 0.98.2 that I compiled myself, and the problem still
arises.

I should say that "simple local unwinding" might be misleading -- my
use of libunwind is simple (local only, and just to get a backtrace),
but my run-time environment is not: I'm using asynchronous signals, and
any signal handler might attempt a backtrace.  If there are any
reentrancy issues in libunwind I'd probably see them, but libunwind
seems well designed to avoid just these sorts of issues, and most of
the time it works just fine.  Still, I have to ask: has anyone
encountered this before, or would anyone care to nominate a potential
smoking gun?

Richard
-- 
Richard C. Bilson, Research Assistant   | School of Computer Science
address@hidden               | University of Waterloo
http://plg.uwaterloo.ca/~rcbilson       | 200 University Avenue West
Office: DC 3548F Ph: (519)888-4567x4822 | Waterloo, Ontario, CANADA N2L 3G1

reply via email to

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