summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/msan
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-02-26 13:38:23 +0000
committerPavel Labath <pavel@labath.sk>2019-02-26 13:38:23 +0000
commit89ae290b58e20fc5f56b7bfae4b34e7fef06e1b1 (patch)
tree90c9223033e575e7063acbb2aa913a7ad64dfb74 /compiler-rt/lib/msan
parent44fad947a5710c96da95423e92a6f27d5070cea4 (diff)
downloadbcm5719-llvm-89ae290b58e20fc5f56b7bfae4b34e7fef06e1b1.tar.gz
bcm5719-llvm-89ae290b58e20fc5f56b7bfae4b34e7fef06e1b1.zip
[Sanitizer] Add interceptor for pthread_sigmask
Summary: pthread_sigmask is just like sigprocmask, except that its behavior in multithreaded programs is explicitly specified. Sanitizers were lacking a common interceptor for pthread_sigmask (although some specific sanitizers defined custom version), which lead to false positives (at least in msan) when using this function. The interceptor implementation, and its test are based on the equivalent code for sigprocmask. Reviewers: eugenis, vitalybuka Subscribers: kubamracek, delcypher, jfb, jdoerfert, llvm-commits, #sanitizers Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D58382 llvm-svn: 354874
Diffstat (limited to 'compiler-rt/lib/msan')
-rw-r--r--compiler-rt/lib/msan/tests/msan_test.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler-rt/lib/msan/tests/msan_test.cc b/compiler-rt/lib/msan/tests/msan_test.cc
index 4bac6f92a72..a3a98301c64 100644
--- a/compiler-rt/lib/msan/tests/msan_test.cc
+++ b/compiler-rt/lib/msan/tests/msan_test.cc
@@ -2579,6 +2579,14 @@ TEST(MemorySanitizer, sigprocmask) {
EXPECT_NOT_POISONED(s);
}
+TEST(MemorySanitizer, pthread_sigmask) {
+ sigset_t s;
+ EXPECT_POISONED(s);
+ int res = pthread_sigmask(SIG_BLOCK, 0, &s);
+ ASSERT_EQ(0, res);
+ EXPECT_NOT_POISONED(s);
+}
+
struct StructWithDtor {
~StructWithDtor();
};
OpenPOWER on IntegriCloud