summaryrefslogtreecommitdiff
path: root/lib/tsan/rtl/tsan_interceptors.cc
Commit message (Collapse)AuthorAge
* [tsan] Fix unused variable warnings.Evgeniy Stepanov2013-10-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193639 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan/asan: support pthread_setname_np to set thread namesDmitry Vyukov2013-10-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193602 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: start the background thread with signals blocked, otherwise it can ↵Dmitry Vyukov2013-10-28
| | | | | | steal users signals git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193519 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept pthread_attr_get*.Evgeniy Stepanov2013-10-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193405 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Move pthread_cond_signal and pthread_cond_broadcast to common ↵Alexey Samsonov2013-10-17
| | | | | | interceptors git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192876 91177308-0d34-0410-b5e6-96231b3b80d8
* Make some pthread_mutex_* and pthread_cond_* interceptors common.Alexey Samsonov2013-10-16
| | | | | | | | | | | | Reviewers: eugenis, dvyukov Reviewed By: dvyukov CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1937 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192774 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: use verbosity flag in sanitizer_common code directlyDmitry Vyukov2013-10-15
| | | | | | | | now it's available from common_flags() git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192705 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: resolve symlinks for called_from_lib suppressionsDmitry Vyukov2013-10-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192688 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: catch more races on file descriptorsDmitry Vyukov2013-10-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192452 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: fix epoll_ctl interceptorDmitry Vyukov2013-10-11
| | | | | | | | | | | | | | | | | | | | | Currently data-race-test unittests fail with the following false positive: WARNING: ThreadSanitizer: data race (pid=20365) Write of size 8 at 0x7da000008050 by thread T54: #0 close tsan_interceptors.cc:1483 (racecheck_unittest-linux-amd64-O0+0x0000000eb34a) #1 NegativeTests_epoll::Worker2() unittest/posix_tests.cc:1148 (racecheck_unittest-linux-amd64-O0+0x0000000cc6b1) #2 MyThread::ThreadBody(MyThread*) unittest/./thread_wrappers_pthread.h:367 (racecheck_unittest-linux-amd64-O0+0x000000097500) Previous read of size 8 at 0x7da000008050 by thread T49: #0 epoll_ctl tsan_interceptors.cc:1646 (racecheck_unittest-linux-amd64-O0+0x0000000e9fee) #1 NegativeTests_epoll::Worker1() unittest/posix_tests.cc:1140 (racecheck_unittest-linux-amd64-O0+0x0000000cc5b5) #2 MyThread::ThreadBody(MyThread*) unittest/./thread_wrappers_pthread.h:367 (racecheck_unittest-linux-amd64-O0+0x000000097500) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192448 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Move the PTHREAD_DESTRUCTOR_ITERATIONS constant to ↵Sergey Matveev2013-10-11
| | | | | | | | sanitizer_linux.h. Add a test. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192442 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: fix a bug in pthread_once when called from an ignored libraryDmitry Vyukov2013-10-04
| | | | | | | | It must set thr->in_rtl = 0 before executing user callback. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191946 91177308-0d34-0410-b5e6-96231b3b80d8
* asan/msan/tsan: move _exit interceptor to common interceptorsDmitry Vyukov2013-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191903 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: intercept _exit so that we can override exit statusDmitry Vyukov2013-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191898 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: ignore interceptors coming from specified librariesDmitry Vyukov2013-10-03
| | | | | | | | | | | | | | | LibIgnore allows to ignore all interceptors called from a particular set of dynamic libraries. LibIgnore remembers all "called_from_lib" suppressions from the provided SuppressionContext; finds code ranges for the libraries; and checks whether the provided PC value belongs to the code ranges. Also make malloc and friends interceptors use SCOPED_INTERCEPTOR_RAW instead of SCOPED_TSAN_INTERCEPTOR, because if they are called from an ignored lib, then must call our internal allocator instead of libc malloc. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191897 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] A bunch of libc interceptors.Evgeniy Stepanov2013-09-25
| | | | | | | | | | | | | sigwait sigwaitinfo sigtimedwait sigemptyset sigfillset sigpending sigprocmask git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191374 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: ignore malloc/free/strdup when called from libjvmDmitry Vyukov2013-09-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191153 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: ignore all interceptors coming directly from JVMDmitry Vyukov2013-09-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191152 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: intercept fork syscallDmitry Vyukov2013-09-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191144 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: intercept close syscallDmitry Vyukov2013-09-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191129 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: handle memory read/write in syscallsDmitry Vyukov2013-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191074 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: do not crash when user intercepts fopen()Dmitry Vyukov2013-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191066 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: fix linking of tsan runtime into dynamic librariesDmitry Vyukov2013-09-19
| | | | | | | | | versioned symbols can not be linked into dynamic library w/o linker script also simplifies code as side effect git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191056 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Fix -Wempty-body warningAlexey Samsonov2013-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190993 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: prevent the following false positive due to __cxa_atexitDmitry Vyukov2013-09-19
| | | | | | | | | | | | | | | | | WARNING: ThreadSanitizer: data race (pid=29103) Write of size 8 at 0x7d64003bbf00 by main thread: #0 free tsan_interceptors.cc:477 #1 __run_exit_handlers <null>:0 (libc.so.6+0x000000050cb7) Previous write of size 8 at 0x7d64003bbf00 by thread T78 (mutexes: write M9896): #0 calloc tsan_interceptors.cc:449 #1 ... git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190989 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: refactor internal IgnoreCtl interfaceDmitry Vyukov2013-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190987 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete unused variables.Eli Friedman2013-09-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190383 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] make calloc crash instead of returning 0 on overflow (controlled by ↵Kostya Serebryany2013-09-06
| | | | | | the allocator_may_return_null flag) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190135 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: catch races on condition variablesDmitry Vyukov2013-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189816 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: properly intercept pthread_cond functionsDmitry Vyukov2013-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189767 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: intercept getaddrinfoDmitry Vyukov2013-08-13
| | | | | | | | | This is necessary to prevent false positives, see: https://code.google.com/p/thread-sanitizer/issues/detail?id=25 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188291 91177308-0d34-0410-b5e6-96231b3b80d8
* [*San/RTL] Fix minor breakageTimur Iskhodzhanov2013-08-13
| | | | | | Grumbling: this hasn't been caught by running 'make check-{a,l,t}san check-sanitizer' git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188262 91177308-0d34-0410-b5e6-96231b3b80d8
* Define SANITIZER_INTERFACE_ATTRIBUTE on Windows and fix all the places where ↵Timur Iskhodzhanov2013-08-13
| | | | | | SANITIZER_INTERFACE_ATTRIBUTE or SANITIZER_ATTRIBUTE_WEAK are used git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188261 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept poll/ppoll.Evgeniy Stepanov2013-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188177 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: treat SIGSYS as synchronous signalDmitry Vyukov2013-07-18
| | | | | | | | | | It is required for chromium sandboxing code. From the description it seems to be indeed synchronous -- called back on syscall with incorrect arguments, but seems to be unused in practice. So this should be fine. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@186579 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: disable one more interceptor that causes recursionDmitry Vyukov2013-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@186497 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] move strcpy and strncpy to common interceptorsAlexey Samsonov2013-07-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@186408 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: support sigsuspend() callDmitry Vyukov2013-07-16
| | | | | | | Intercepting it makes it process pending signal before return. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@186400 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Support GLOB_ALTDIRFUNC in glob interceptor.Evgeniy Stepanov2013-07-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@185932 91177308-0d34-0410-b5e6-96231b3b80d8
* Hide mlock/munlock info message under verbosity flag.Alexey Samsonov2013-07-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@185314 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: add missing __attribute__((visibility("default"))) to interface functionsDmitry Vyukov2013-06-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@184858 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept readv, preadv, writev, pwritev.Evgeniy Stepanov2013-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@184717 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: consistently use return pc as top frame pcDmitry Vyukov2013-06-17
| | | | | | | | always substract 1 from the top pc this allows to get correct stacks with -O2 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@184112 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: disable getaddrinfo() interceptor for tsan (causes recursion)Dmitry Vyukov2013-06-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183649 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Move TSan and MSan recvmsg interceptors to common.Evgeniy Stepanov2013-05-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182843 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Share TSan accept & accept4 interceptors with other sanitizers.Evgeniy Stepanov2013-05-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182835 91177308-0d34-0410-b5e6-96231b3b80d8
* [nolibc] Move all platforms to internal_getpid.Peter Collingbourne2013-05-17
| | | | | | | | | | Before, we had an unused internal_getpid function for Linux, and a platform-independent GetPid function. To make the naming conventions consistent for syscall-like functions, the GetPid syscall wrapper in sanitizer_posix.cc is moved to sanitizer_mac.cc, and GetPid is renamed to internal_getpid, bringing the Linux variant into use. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182132 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: disable getpwuid_r() and glob64() interceptors under tsan, because ↵Dmitry Vyukov2013-04-24
| | | | | | they cause interceptor recursion if user intercepts fopen() git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@180182 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Add syscall handlers to ASan and TSan runtimes.Evgeniy Stepanov2013-04-12
| | | | | | | ASan checks addressability of syscall arguments. TSan does nothing for now. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@179380 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove all 'static' before ALWAYS_INLINETimur Iskhodzhanov2013-03-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@178290 91177308-0d34-0410-b5e6-96231b3b80d8