1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-07-04 14:35:34 +02:00
Commit graph

12 commits

Author SHA1 Message Date
Yichao Yu 4238fa55c8 Fix intermittent test failure in test-resume-sig (#51)
(At least on x86(_32),) `unw_resume` will call `setcontext` which will modify the signal masks
based on the value in the context. Since the signal mask is not being initialized by
`unw_getcontext`, this cause the signal mask to be set to a random (uninitialized) value after
`unw_resume` which cause the test to fail since it relies on the signal mask for SIGUSR2 being
cleared.

The proper fix is likely to either make `unw_resume` not touch the signal mask if the context
wasn't initialized with a signal ucontext, or to make `unw_getcontext` record the signal mask too.
It's unclear to me which approach should be taken...

In the mean time, the intermittent failure can be fixed simply by zero initialing the context first
which would clear all the signal masks.
When siginfo is available, a more reliable way is to use the `ucontext` passed in
to the signal handler directly and rely on `sigreturn` to reset it.
Unfortunately, this is currently not implemented on all archs either.
2017-10-31 08:47:34 -07:00
Dave Watson 29483327be x86_64: Use sigprocmask from signal frames
Currently setcontext for x86_64 restores the signal mask, even
though it is never saved anywhere.  This means the signal mask
is often garbage after an unw_resume.

(changed in commit f8a15e9679)

It looks like this was a fix for the Gtest-resume-sig function -
testing if signal masks are restored across signal frames.  The
root issue looks like that x86_64 only uses sigreturn for the exact
signal frame, and not for any decedant frames as well (as i64 does).

Instead, modify Gresume to use sigreturn if *any* frame on the stack
is a signal frame, so that we correct fixup the signal mask and any
sigaltstacks.  The sigreturn os-specific functions are changed slightly
to copy in the saved ucontext structure if we are jumping farther
up the stack.

This should fix sigprocmask reported issues such as
https://github.com/dropbox/pyston/blob/master/libunwind_patches/0002-pyston-stop-x86_64-setcontext-restoring-uninitialize.patch

Tests pass on freebsd, linux
2017-01-13 08:28:22 -08:00
Zhi-Gang Liu 790be1e40d Add TileGx platform support to libunwind.
"make check" passed.
======================================================
All 34 tests behaved as expected (2 expected failures)
======================================================
Zhi-Gang Liu @ Tilera
2014-09-08 16:21:53 -04:00
Tommi Rantala 6b55e0ab51 Use `UNUSED' in tests 2012-09-28 14:51:21 +03:00
Tommi Rantala 5b55e556ca test-resume-sig-rt: test unw_resume() in presence of "realtime" signal frame
Introduce a new test case that is derived from test-resume-sig, but
using the SA_SIGINFO sigaction() flag. This case is referred in the
linux kernel sources as "realtime" signal handler, and is handled
differently in the kernel on many architectures and in libunwind as
well.
2012-08-21 22:33:56 +03:00
Tommi Rantala f42a8de0fa Annotate unused parameters in tests
Compiling the tests with -Wextra results to lots of warnings for unused
parameters. Annotate these cases with the `unused' attribute to avoid
the warnings.
2012-08-21 22:30:46 +03:00
Arun Sharma f8a15e9679 Fix a couple of test breakages on x86_64
setcontext() now restores the signal mask. Also remove a check
in the test that doesn't seem to be valid.
2010-03-10 22:52:12 -08:00
mostang.com!davidm d9445c1f46 (handler): get_bsp() returns an integer, not a pointer.
(main): Do some silly FP computations.  On x86-64, this ensures
	that the signal handler invocations will always be called
	with the FPU-state saved as well.  Without this, the first
	signal was invoked without FPU-state, the second with, causing
	a spurious failure.

2004/11/17 02:06:25-08:00 mostang.com!davidm
(get_bsp): New function.
(handler): Clean up & check for error returns.
(main): Also fail if we didn't get SIGUSR2.

(Logical change 1.290)
2005-05-03 09:13:17 +00:00
hp.com!davidm 722933b6bc Cast printf() argument to avoid compiler warning.
(Logical change 1.130)
2003-11-27 06:52:54 +00:00
mostang.com!davidm 43d0e03dc6 If we have it, include "config.h".
If we have it, include <ia64intrin.h>
(handler): Add support for ECC.

(Logical change 1.68)
2003-03-27 04:29:07 +00:00
hp.com!davidm 899ce01967 D
2003/02/21 18:59:31-08:00 hp.com!davidm
Rename: tests/test-resume-sig.c -> tests/Gtest-resume-sig.c

(Logical change 1.53)
2003-02-22 03:08:22 +00:00
hp.com!davidm 37d99c0c9f Initial revision 2003-02-22 03:08:22 +00:00