diff options
author | Kuba Brecka <kuba.brecka@gmail.com> | 2015-11-30 14:11:02 +0000 |
---|---|---|
committer | Kuba Brecka <kuba.brecka@gmail.com> | 2015-11-30 14:11:02 +0000 |
commit | bf7591143730af512bcfd5dd4337e313edbde4cb (patch) | |
tree | fca1173ee0534ec6d2acdcde860bdb2e4e37f222 /test | |
parent | 07b33efb4763cca7b7b8dc30ceca0b6caf1982ce (diff) |
[tsan] Fix signals and setjmp/longjmp on OS X
1) There's a few wrongly defined things in tsan_interceptors.cc,
2) a typo in tsan_rtl_amd64.S which calls setjmp instead of sigsetjmp in the interceptor, and
3) on OS X, accessing an mprotected page results in a SIGBUS (and not SIGSEGV).
Differential Revision: http://reviews.llvm.org/D15052
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/tsan/signal_longjmp.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/tsan/signal_longjmp.cc b/test/tsan/signal_longjmp.cc index 2525c8988..bc8b0dfc4 100644 --- a/test/tsan/signal_longjmp.cc +++ b/test/tsan/signal_longjmp.cc @@ -12,6 +12,12 @@ #include <stdio.h> #include <sys/mman.h> +#ifdef __APPLE__ +#define SIGNAL_TO_HANDLE SIGBUS +#else +#define SIGNAL_TO_HANDLE SIGSEGV +#endif + sigjmp_buf fault_jmp; volatile int fault_expected; @@ -44,7 +50,7 @@ int main() { exit(1); } - if (sigaction(SIGSEGV, &act, NULL)) { + if (sigaction(SIGNAL_TO_HANDLE, &act, NULL)) { perror("sigaction"); exit(1); } |