summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl
Commit message (Collapse)AuthorAgeFilesLines
...
* tsan: output stats about stackdepot in memory profilerDmitry Vyukov2014-10-031-1/+4
| | | | | | | | | | | quite amusing on some programs: RSS 9152 MB: shadow:2456 meta:1736 file:454 mmap:3442 trace:196 heap:866 other:0 stacks=176[1065994] nthr=157/159 ... RSS 30192 MB: shadow:613 meta:5550 file:1839 mmap:20487 trace:212 heap:1489 other:0 stacks=12870[1599445] nthr=162/165 ... RSS 42232 MB: shadow:599 meta:8199 file:2304 mmap:29420 trace:213 heap:1494 other:0 stacks=17794[1690645] nthr=162/165 llvm-svn: 218988
* tsan: more careful handling of signalsDmitry Vyukov2014-09-181-21/+33
| | | | | | | | | | | | | | | On some tests we see that signals are not delivered when a thread is blocked in epoll_wait. The hypothesis is that the signal is delivered right before epoll_wait call. The signal is queued as in_blocking_func is not set yet, and then the thread just blocks in epoll_wait forever. So double check pending signals *after* setting in_blocking_func. This way we either queue a signal and handle it in the beginning of a blocking func, or process the signal synchronously if it's delivered when in_blocking_func is set. llvm-svn: 218070
* tsan: fix crash when a program registers zillions of atexit callbacksDmitry Vyukov2014-09-171-1/+0
| | | | | | | | | | I don't remember that crash on mmap in internal allocator ever yielded anything useful, only crashes in rare wierd untested situations. One of the reasons for crash was to catch if tsan starts allocating clocks using mmap. Tsan does not allocate clocks using internal_alloc anymore. Solve it once and for all by allowing mmaps. llvm-svn: 217929
* tsan: support longjmp out of signal handlersDmitry Vyukov2014-09-162-0/+15
| | | | | | Fixes https://code.google.com/p/thread-sanitizer/issues/detail?id=75 llvm-svn: 217908
* tsan: use growable vector for atexit callbacksDmitry Vyukov2014-09-121-10/+6
| | | | | | Most real programs setup much more than 1024 callbacks. llvm-svn: 217713
* [TSan] Use common flags in the same way as all the other sanitizersAlexey Samsonov2014-09-107-44/+37
| | | | llvm-svn: 217559
* [Sanitizer] Get rid of Symbolizer::Get() and Symbolizer::GetOrNull().Alexey Samsonov2014-09-101-3/+3
| | | | | | | | | We may as well just use Symbolizer::GetOrInit() in all the cases. Don't call Symbolizer::Get() early in tools initialization: these days it doesn't do any important setup work, and we may as well create the symbolizer the first time it's actually needed. llvm-svn: 217558
* tsan: handle early signalsDmitry Vyukov2014-09-033-4/+3
| | | | | | | The second part of the fix of https://code.google.com/p/thread-sanitizer/issues/detail?id=71 llvm-svn: 217031
* tsan: more precise handling of atexit callbacksDmitry Vyukov2014-09-021-30/+57
| | | | | | Fixes issue https://code.google.com/p/thread-sanitizer/issues/detail?id=74 llvm-svn: 216906
* tsan: disable getpwent interceptorsDmitry Vyukov2014-09-021-0/+12
| | | | | | | | | | | There interceptors do not seem to be strictly necessary for tsan. But we see cases where the interceptors consume 70% of execution time. Memory blocks passed to fgetgrent_r are "written to" by tsan several times. First, there is some recursion (getgrnam_r calls fgetgrent_r), and each function "writes to" the buffer. Then, the same memory is "written to" twice, first as buf and then as pwbufp (both of them refer to the same addresses). llvm-svn: 216904
* tsan: restructure signal handling to allow recursive handlingDmitry Vyukov2014-09-023-24/+31
| | | | | | | Fixes issue https://code.google.com/p/thread-sanitizer/issues/detail?id=71 llvm-svn: 216903
* tsan: address comments in r214912Dmitry Vyukov2014-09-022-36/+37
| | | | | | See http://reviews.llvm.org/D4794 llvm-svn: 216900
* tsan: fix false positive related to signal handlersDmitry Vyukov2014-09-011-0/+2
| | | | | | | Users expect synchronization between sigaction and arrival of the signal. See the test for details. llvm-svn: 216878
* [sanitizer] move mlock interceptor from asan/tsan/msan to common; no ↵Kostya Serebryany2014-08-251-34/+0
| | | | | | functionality change intended llvm-svn: 216407
* [TSan] Initialize flags as early as possible. Disables back coredump, ↵Alexey Samsonov2014-08-155-11/+8
| | | | | | accidentally enabled in r215479. Add a test. llvm-svn: 215763
* tsan: fix unaligned memory access routineDmitry Vyukov2014-08-131-3/+3
| | | | | | It was possimitically handling an aligned 8-byte access as 2 4-byte accesses. llvm-svn: 215546
* [TSan] Share the code the setup code calling getrlim/setrlim with ↵Alexey Samsonov2014-08-122-31/+5
| | | | | | sanitizer_common llvm-svn: 215481
* [Sanitizer] Make disable_coredump a common flag and use it in TSanAlexey Samsonov2014-08-121-2/+1
| | | | llvm-svn: 215479
* [Sanitizer] Kill deprecated allocator interfaces in ASan, MSan and TSan in ↵Alexey Samsonov2014-08-121-30/+0
| | | | | | | | favor of a unified interface in <sanitizer/allocator_interface.h>. llvm-svn: 215469
* tsan: allocate vector clocks using slab allocatorDmitry Vyukov2014-08-058-88/+204
| | | | | | | | | | Vector clocks is the most actively allocated object in tsan runtime. Current internal allocator is not scalable enough to handle allocation of clocks in scalable way (too small caches). This changes transforms clocks to 2-level array with 512-byte blocks. Since all blocks are of the same size, it's possible to cache them more efficiently in per-thread caches. llvm-svn: 214912
* [Sanitizer] Turn SuppressionContext::Init() into InitIfNecessary().Alexey Samsonov2014-08-051-1/+5
| | | | | | | Suppression context might be used in multiple sanitizers working simultaneously (e.g. LSan and UBSan) and not knowing about each other. llvm-svn: 214831
* tsan: use MADV_NOHUGEPAGE only if it is supported by platformDmitry Vyukov2014-07-311-0/+2
| | | | | | | Fixes build failure on an old system: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-centos-6.5/builds/7555/steps/build/logs/stdio llvm-svn: 214394
* [Sanitizer] Hoist the code parsing suppressions file into sanitizer_common.Alexey Samsonov2014-07-301-36/+1
| | | | | | Remove corresponding bits from LSan and TSan runtimes. No functionality change. llvm-svn: 214344
* [Sanitizer] Make "suppressions" and "print_suppressions" common runtime flags.Alexey Samsonov2014-07-302-8/+1
| | | | | | No functionality change. llvm-svn: 214343
* [Sanitizer] Make SuppressionContext a singleton class, residing in ↵Alexey Samsonov2014-07-303-26/+15
| | | | | | | | | | sanitizer_common. Convert TSan and LSan to the new interface. More changes will follow: 1) "suppressions" should become a common runtime flag. 2) Code for parsing suppressions file should be moved to SuppressionContext::Init(). llvm-svn: 214334
* tsan: add a useful debug checkDmitry Vyukov2014-07-281-0/+1
| | | | llvm-svn: 214082
* tsan: advise shadow for 0x7f region to not use huge pagesDmitry Vyukov2014-07-261-0/+6
| | | | | | see the comment for justification llvm-svn: 214030
* [Sanitizer] Simplify Symbolizer creation interface.Alexey Samsonov2014-07-261-2/+1
| | | | | | | | | | | Get rid of Symbolizer::Init(path_to_external) in favor of thread-safe Symbolizer::GetOrInit(), and use the latter version everywhere. Implicitly depend on the value of external_symbolizer_path runtime flag instead of passing it around manually. No functionality change. llvm-svn: 214005
* tsan: query RSS every 100msDmitry Vyukov2014-07-251-3/+1
| | | | | | Now that it become faster, it's OK to query it every 100ms again. llvm-svn: 213943
* tsan: fix and make faster GetRSSDmitry Vyukov2014-07-251-3/+24
| | | | | | | | It is currently broken because it reads a wrong value from profile (heap instead of total). Also make it faster by reading /proc/self/statm. Reading of /proc/self/smaps can consume more than 50% of time on beefy apps if done every 100ms. llvm-svn: 213942
* tsan: fix Go runtime build with clangDmitry Vyukov2014-07-181-4/+4
| | | | llvm-svn: 213384
* tsan: expose atomic operations in Go runtimeDmitry Vyukov2014-07-181-48/+145
| | | | llvm-svn: 213382
* tsan: remove special handling of false reports coming from JVMDmitry Vyukov2014-07-153-43/+0
| | | | | | There is now a more common functionality in the form of called_from_lib suppressions. llvm-svn: 213057
* tsan: remove compat mappingDmitry Vyukov2014-07-154-47/+2
| | | | | | There are no known usages anymore, so one less thing to support. llvm-svn: 213056
* tsan: reapply 212531 and 212532 with a fixDmitry Vyukov2014-07-081-4/+5
| | | | | | don't reset s->addr as well llvm-svn: 212565
* [TSan] Revert r212531 and r212532.Alexey Samsonov2014-07-081-4/+3
| | | | | | They cause "check-tsan" command to hang. Details in r212532 review thread. llvm-svn: 212562
* tsan: allow memory overlap in __tsan_java_moveDmitry Vyukov2014-07-083-6/+23
| | | | | | JVM actually moves memory between overlapping ranges. llvm-svn: 212560
* [tsan] Enable tsan's deadlock detector by default.Kostya Serebryany2014-07-081-0/+1
| | | | | | | | The tsan's deadlock detector has been used in Chromium for a while; it found a few real bugs and reported no false positives. So, it's time to give it a bit more exposure. llvm-svn: 212533
* tsan: fix a potential hangDmitry Vyukov2014-07-081-2/+4
| | | | | | | idx0 is not updated in the branch, so if we take that branch idx0 will stay updated forever llvm-svn: 212532
* tsan: fix a bug in metamapDmitry Vyukov2014-07-081-1/+0
| | | | | | | | | The bug happens in the following case: Mutex is located at heap block beginning, when we call MutexDestroy, s->next is set to 0, so free can't find the MBlock related to the block. llvm-svn: 212531
* [tsan] fix deadlock detector's interoperation with java locks ↵Kostya Serebryany2014-07-081-1/+1
| | | | | | (https://code.google.com/p/thread-sanitizer/issues/detail?id=67) llvm-svn: 212529
* [tsan] fix pthread_rwlock_tryrdlock interceptor, don't try to detect ↵Kostya Serebryany2014-07-082-3/+3
| | | | | | deadlocks when reporting bad unlock llvm-svn: 212526
* Generalize sanitizer allocator public interface.Alexey Samsonov2014-07-072-9/+40
| | | | | | | | | | | | | | Introduce new public header <sanitizer/allocator_interface.h> and a set of functions __sanitizer_get_ownership(), __sanitizer_malloc_hook() etc. that will eventually replace their tool-specific equivalents (__asan_get_ownership(), __msan_get_ownership() etc.). Tool-specific functions are now deprecated and implemented as stubs redirecting to __sanitizer_ versions (which are implemented differently in each tool). Replace all uses of __xsan_ versions with __sanitizer_ versions in unit and lit tests. llvm-svn: 212469
* [sanitizer] support c11 aligned_alloc, Linux only for nowKostya Serebryany2014-07-041-0/+5
| | | | llvm-svn: 212322
* [TSan] Equalize the behavior of __tsan_get_allocated_size and ↵Alexey Samsonov2014-07-013-8/+5
| | | | | | | | | | | user_alloc_usable_size. The former used to crash with a null deref if it was given a not owned pointer, while the latter returned 0. Now they both return 0. This is still not the best possible behavior: it is better to print an error report with a stack trace, pointing to the error in user code, as we do in ASan. llvm-svn: 212112
* tsan: add __tsan_java_finalize interface functionDmitry Vyukov2014-06-272-0/+11
| | | | | | | It is required to prevent false positives between object ctor and finalizer, as otherwise they look completely unsynchronized. llvm-svn: 211829
* tsan: fix code formattingDmitry Vyukov2014-06-211-1/+1
| | | | llvm-svn: 211429
* tsan: port to freebsdDmitry Vyukov2014-06-201-2/+16
| | | | llvm-svn: 211418
* tsan: remove unused header includeDmitry Vyukov2014-06-201-1/+0
| | | | llvm-svn: 211389
* tsan: remove unused header includeDmitry Vyukov2014-06-201-1/+0
| | | | llvm-svn: 211386
OpenPOWER on IntegriCloud