[compiler-rt] r232073 - [Tsan] Adjust SA_SIGINFO and SIG_SETMASK values on FreeBSD.
Viktor Kutuzov
vkutuzov at accesssoftek.com
Thu Mar 12 11:12:44 PDT 2015
Author: vkutuzov
Date: Thu Mar 12 13:12:43 2015
New Revision: 232073
URL: http://llvm.org/viewvc/llvm-project?rev=232073&view=rev
Log:
[Tsan] Adjust SA_SIGINFO and SIG_SETMASK values on FreeBSD.
Differential Revision: http://reviews.llvm.org/D8176
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=232073&r1=232072&r2=232073&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Thu Mar 12 13:12:43 2015
@@ -145,7 +145,10 @@ struct sigaction_t {
const sighandler_t SIG_DFL = (sighandler_t)0;
const sighandler_t SIG_IGN = (sighandler_t)1;
const sighandler_t SIG_ERR = (sighandler_t)-1;
-#ifdef __mips__
+#if SANITIZER_FREEBSD
+const int SA_SIGINFO = 0x40;
+const int SIG_SETMASK = 3;
+#elif defined(__mips__)
const int SA_SIGINFO = 8;
const int SIG_SETMASK = 3;
#else
@@ -1949,8 +1952,8 @@ void ProcessPendingSignals(ThreadState *
atomic_fetch_add(&thr->in_signal_handler, 1, memory_order_relaxed);
// These are too big for stack.
static THREADLOCAL __sanitizer_sigset_t emptyset, oldset;
- REAL(sigfillset)(&emptyset);
- pthread_sigmask(SIG_SETMASK, &emptyset, &oldset);
+ CHECK_EQ(0, REAL(sigfillset)(&emptyset));
+ CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &emptyset, &oldset));
for (int sig = 0; sig < kSigCount; sig++) {
SignalDesc *signal = &sctx->pending_signals[sig];
if (signal->armed) {
@@ -1959,7 +1962,7 @@ void ProcessPendingSignals(ThreadState *
&signal->siginfo, &signal->ctx);
}
}
- pthread_sigmask(SIG_SETMASK, &oldset, 0);
+ CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &oldset, 0));
atomic_fetch_add(&thr->in_signal_handler, -1, memory_order_relaxed);
}
More information about the llvm-commits
mailing list