forked from OSchip/llvm-project
[compiler-rt] XFAIL test on iOS
On iOS, when we `longjmp()` out of the signal handler, a subsequent call to `sigaltstack()` still reports that we are executing on the signal handler stack. Tracking rdar://66789814 Differential Revision: https://reviews.llvm.org/D85677
This commit is contained in:
parent
ec5f793996
commit
bfb0b853b2
|
@ -6,6 +6,8 @@
|
|||
// RUN: %clangxx_asan -std=c++20 -fexceptions -O0 %s -o %t -pthread
|
||||
// RUN: %run %t
|
||||
|
||||
// XFAIL: ios && !iossim
|
||||
|
||||
#include <cassert>
|
||||
#include <cerrno>
|
||||
#include <csetjmp>
|
||||
|
@ -62,12 +64,14 @@ void testOnCurrentStack() {
|
|||
c.RightRedzone - c.LeftRedzone));
|
||||
}
|
||||
|
||||
bool isOnSignalStack() {
|
||||
stack_t Stack;
|
||||
sigaltstack(nullptr, &Stack);
|
||||
return Stack.ss_flags == SS_ONSTACK;
|
||||
}
|
||||
|
||||
void signalHandler(int, siginfo_t *, void *) {
|
||||
{
|
||||
stack_t Stack;
|
||||
sigaltstack(nullptr, &Stack);
|
||||
assert(Stack.ss_flags == SS_ONSTACK);
|
||||
}
|
||||
assert(isOnSignalStack());
|
||||
|
||||
// test on signal alternate stack
|
||||
testOnCurrentStack();
|
||||
|
@ -110,6 +114,8 @@ void *threadFun(void *AltStack) {
|
|||
// Test on signal alternate stack, via signalHandler
|
||||
poisonStackAndJump(defaultStack, [] { raise(SIGUSR1); });
|
||||
|
||||
assert(!isOnSignalStack());
|
||||
|
||||
assert(0 == __asan_region_is_poisoned(
|
||||
defaultStack.LeftRedzone,
|
||||
defaultStack.RightRedzone - defaultStack.LeftRedzone));
|
||||
|
|
Loading…
Reference in New Issue