[Sanitizer] Add interceptor for pthread_sigmask
authorPavel Labath <pavel@labath.sk>
Tue, 26 Feb 2019 13:38:23 +0000 (13:38 +0000)
committerPavel Labath <pavel@labath.sk>
Tue, 26 Feb 2019 13:38:23 +0000 (13:38 +0000)
commit89ae290b58e20fc5f56b7bfae4b34e7fef06e1b1
tree90c9223033e575e7063acbb2aa913a7ad64dfb74
parent44fad947a5710c96da95423e92a6f27d5070cea4
[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
compiler-rt/lib/esan/esan_interceptors.cpp
compiler-rt/lib/msan/tests/msan_test.cc
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
compiler-rt/lib/tsan/rtl/tsan_interceptors.cc