libunwind-devel
[Top][All Lists]
Advanced

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

[libunwind] ia64 update to support resuming into floating register-stack


From: David Mosberger
Subject: [libunwind] ia64 update to support resuming into floating register-stack frame
Date: Tue, 31 Aug 2004 07:17:23 -0700

A minute ago, I pushed a (mostly) ia64-update into libunwind which
makes it possible to reliably resume execution in a function whose
register-stack frame is "floating" (i.e., isn't backed by valid
memory).

This means that a function can now setup a jump-buffer (via the
{sig,}setjmp() from libunwind-setjump.a) or an exception handler and
be assured that the longjmp/exception handler can be invoked even if
the stacked register frame of that function was already overflowing
the available backing store.  Of course, if the actual
longjmp/exception handler allocates stacked register on its own (or
calls other subroutines), then execution may still fail.  But as far
as libunwind is concerned, this is the best it can do.  The rest is up
to the compilers and programmers of longjmp() handlers.

I added a test-case for this (tests/ia64-test-setjmp), which calls a
function recursively until the backing store bumps into an mprotect'ed
page.  The SIGSEGV-handler then longjmps back to the most recent frame
which was able to execute successfully.  This failed with libunwind
v0.97 but works now as desired.

As a side-effect, I also improved compatibility of libunwind-setjmp
with glibc (and NPTL in particular).  While it's of course not
possible to mix jump-buffers between different setjmp/longjmp
implementations, the improvement should make the NPTL
pthread_cleanup() code work properly (it peeks at SP and, on ia64,
BSP, in the jump-buffer).

Please let me know if you find any problems.

Enjoy,

        --david


reply via email to

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