summaryrefslogtreecommitdiff
path: root/lib/tsan
Commit message (Collapse)AuthorAgeFilesLines
* Merging r196501:Alexey Samsonov2013-12-052-3/+4
| | | | | | | | | | | ------------------------------------------------------------------------ r196501 | samsonov | 2013-12-05 16:53:36 +0400 (Thu, 05 Dec 2013) | 1 line Run TSan/MSan lit tests only on 64-bit platforms ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_34@196502 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: add support for robust mutexesDmitry Vyukov2013-11-155-2/+96
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194823 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: add proper cfi directives to assembly codeDmitry Vyukov2013-11-151-2/+2
| | | | | | | | this allows gdb to unwind through our hacky call git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194803 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply asan coverage changes 194702-194704.Bob Wilson2013-11-151-12/+0
| | | | | | | | I still don't know what is causing our bootstrapped LTO buildbots to fail, but llvm r194701 seems to be OK and I can't imagine that these changes could cause the problem. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194790 91177308-0d34-0410-b5e6-96231b3b80d8
* Speculatively revert asan coverage changes 194702-194704.Bob Wilson2013-11-151-0/+12
| | | | | | | | | Apple's bootstrapped LTO builds have been failing, and these changes (along with llvm 194701) are the only things on the blamelist. I will either reapply these changes or help debug the problem, depending on whether this fixes the buildbots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194779 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Poor man's coverage that works with ASan (compiler-rt part)Kostya Serebryany2013-11-141-12/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194702 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Specify a default value for each common runtime flagAlexey Samsonov2013-11-121-11/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194479 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Avoid needless use of stringification (#symver) in ↵Evgeniy Stepanov2013-11-121-2/+2
| | | | | | | | | INTERCEPT_FUNCTION_VER. This is a workaround for clang-format bug (PR17874). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194468 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Warn if interception fails.Evgeniy Stepanov2013-11-111-0/+1
| | | | | | | | This includes a clang-format pass over common interceptors. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194372 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Make StackTrace::Unwind the only public way to unwind a stack trace.Alexey Samsonov2013-11-071-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194196 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept strptime.Evgeniy Stepanov2013-11-022-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193903 91177308-0d34-0410-b5e6-96231b3b80d8
* tsna: do not call user code from within runtime (from fflush)Dmitry Vyukov2013-11-011-1/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193880 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Add Symbolizer::AddHooks() and use it in TSan and MSan.Alexey Samsonov2013-10-313-15/+13
| | | | | | | | | | | | | | | | | | | | | Summary: TSan and MSan need to know if interceptor was called by the user code or by the symbolizer and use pre- and post-symbolization hooks for that. Make Symbolizer class responsible for calling these hooks instead. This would ensure the hooks are only called when necessary (during in-process symbolization, they are not needed for out-of-process) and save specific sanitizers from tracing all places in the code where symbolization will be performed. Reviewers: eugenis, dvyukov Reviewed By: eugenis CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2067 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193807 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept getline, getdelim.Evgeniy Stepanov2013-10-312-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193730 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept drand48_r, lrand48_r.Evgeniy Stepanov2013-10-292-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193655 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept sincos, remquo, lgamma, lgamma_r.Evgeniy Stepanov2013-10-292-0/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193645 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Fix unused variable warnings.Evgeniy Stepanov2013-10-291-4/+9
| | | | 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-294-0/+50
| | | | 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-281-0/+6
| | | | | | steal users signals git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193519 91177308-0d34-0410-b5e6-96231b3b80d8
* Overhaul the symbolizer interface.Peter Collingbourne2013-10-252-10/+10
| | | | | | | | | | | | | | | | | | | | | | This moves away from creating the symbolizer object and initializing the external symbolizer as separate steps. Those steps now always take place together. Sanitizers with a legacy requirement to specify their own symbolizer path should use InitSymbolizer to initialize the symbolizer with the desired path, and GetSymbolizer to access the symbolizer. Sanitizers with no such requirement (e.g. UBSan) can use GetOrInitSymbolizer with no need for initialization. The symbolizer interface has been made thread-safe (as far as I can tell) by protecting its member functions with mutexes. Finally, the symbolizer interface no longer relies on weak externals, the introduction of which was probably a mistake on my part. Differential Revision: http://llvm-reviews.chandlerc.com/D1985 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193448 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept tmpnam, tmpnam_r, tempnam.Evgeniy Stepanov2013-10-252-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193415 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Remove pthread_attr_getstackaddr interceptor.Evgeniy Stepanov2013-10-252-2/+0
| | | | | | | The function is deprecated. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193409 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept pthread_attr_get*.Evgeniy Stepanov2013-10-253-3/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193405 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: do not crash when apparently bogus fd is passed to e.g. closeDmitry Vyukov2013-10-251-2/+34
| | | | | | | | | | some tests test libc/filesystem error handling paths (e.g. close(INT_MAX)), currently such tests fail with this change they work as expected git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193400 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept random_r.Evgeniy Stepanov2013-10-252-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193396 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept shmctl.Evgeniy Stepanov2013-10-242-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193348 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept ether_* functions.Evgeniy Stepanov2013-10-232-0/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193241 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept initgroups.Evgeniy Stepanov2013-10-222-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193158 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Move statfs/fstatfs to common interceptors and add statvfs/fstatvfs.Evgeniy Stepanov2013-10-182-0/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192965 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept getmntent, getmntent_r.Evgeniy Stepanov2013-10-182-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192959 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Move pthread_cond_signal and pthread_cond_broadcast to common ↵Alexey Samsonov2013-10-171-16/+0
| | | | | | interceptors git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192876 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: merge 2 similar tests into 1Dmitry Vyukov2013-10-173-40/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192874 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: add a test for __tsan_default_options()Dmitry Vyukov2013-10-172-8/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192873 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: revert variable name change in testDmitry Vyukov2013-10-161-5/+5
| | | | | | | | It works as is with new llvm-symbolizer. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192798 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: move shadow stack from thread descriptors to fixed addressesDmitry Vyukov2013-10-1612-33/+132
| | | | | | | | | | This allows to increase max shadow stack size to 64K, and reliably catch shadow stack overflows instead of silently corrupting memory. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192797 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Extend test for reporting globals with races on themAlexey Samsonov2013-10-162-4/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192782 91177308-0d34-0410-b5e6-96231b3b80d8
* Make some pthread_mutex_* and pthread_cond_* interceptors common.Alexey Samsonov2013-10-161-36/+6
| | | | | | | | | | | | 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: introduce __tsan_default_options() functionDmitry Vyukov2013-10-151-24/+41
| | | | | | | | | The function allows to statically setup default values for flags. The interafece matches what asan/msan provide. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192715 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: use verbosity flag in sanitizer_common code directlyDmitry Vyukov2013-10-151-7/+1
| | | | | | | | 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: move verbosity flag to CommonFlagsDmitry Vyukov2013-10-152-8/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192701 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: fix Go buildDmitry Vyukov2013-10-151-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192696 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: do not build llvm from scratch on each presubmitDmitry Vyukov2013-10-151-3/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192694 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: use sanitizer::CommonFlags in tsanDmitry Vyukov2013-10-154-28/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192692 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: resolve symlinks for called_from_lib suppressionsDmitry Vyukov2013-10-151-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192688 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: allow to override OnFinalize() in front-ends that does not support ↵Dmitry Vyukov2013-10-141-1/+5
| | | | | | weak functions (Go) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192569 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: catch more races on file descriptorsDmitry Vyukov2013-10-112-2/+12
| | | | 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-111-6/+8
| | | | | | | | | | | | | | | | | | | | | 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-111-1/+2
| | | | | | | | 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: minor refactoringDmitry Vyukov2013-10-101-6/+1
| | | | | | | | Replace duplicate code snippet with function. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192357 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: add annotations to ignore synchronization operationsDmitry Vyukov2013-10-109-64/+161
| | | | | | | | | | The annotations are AnnotateIgnoreSyncBegin/End, may be useful to ignore some infrastructure synchronization that introduces lots of false negatives. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192355 91177308-0d34-0410-b5e6-96231b3b80d8