[compiler-rt] r202022 - tsan: fix SIGRTMAX handling

Dmitry Vyukov dvyukov at google.com
Mon Feb 24 03:28:59 PST 2014


Author: dvyukov
Date: Mon Feb 24 05:28:59 2014
New Revision: 202022

URL: http://llvm.org/viewvc/llvm-project?rev=202022&view=rev
Log:
tsan: fix SIGRTMAX handling


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=202022&r1=202021&r2=202022&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Mon Feb 24 05:28:59 2014
@@ -29,7 +29,7 @@
 
 using namespace __tsan;  // NOLINT
 
-const int kSigCount = 64;
+const int kSigCount = 65;
 
 struct my_siginfo_t {
   // The size is determined by looking at sizeof of real siginfo_t on linux.
@@ -1704,6 +1704,10 @@ void ALWAYS_INLINE rtl_generic_sighandle
     my_siginfo_t *info, void *ctx) {
   ThreadState *thr = cur_thread();
   SignalContext *sctx = SigCtx(thr);
+  if (sig < 0 || sig >= kSigCount) {
+    VPrintf(1, "ThreadSanitizer: ignoring signal %d\n", sig);
+    return;
+  }
   // Don't mess with synchronous signals.
   const bool sync = is_sync_signal(sctx, sig);
   if (sync ||





More information about the llvm-commits mailing list