summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl
Commit message (Collapse)AuthorAgeFilesLines
...
* [sanitizer] Intercept pthread_*attr_get*.Evgeniy Stepanov2014-06-191-2/+2
| | | | | | This is a resubmit of r211166 reverted due to osx breakage. llvm-svn: 211264
* Revert "[sanitizer] Intercept pthread_*attr_get*."Arnold Schwaighofer2014-06-181-2/+2
| | | | | | This reverts commit r211166. It broke public mac os x bots. llvm-svn: 211206
* [sanitizer] Intercept pthread_*attr_get*.Evgeniy Stepanov2014-06-181-2/+2
| | | | llvm-svn: 211166
* tsan: fix CurrentStackIdDmitry Vyukov2014-06-061-14/+28
| | | | | | FuncEnter adds FuncEnter entry to trace that nobody removes later llvm-svn: 210359
* tsan: fix mutex in Go modeDmitry Vyukov2014-06-061-1/+1
| | | | | | In Go it's legal to unlock from a different goroutine. llvm-svn: 210358
* tsan: disable reporting of mutex misuses in GoDmitry Vyukov2014-06-061-0/+4
| | | | llvm-svn: 210353
* tsan: minor optimizations for Go runtimeDmitry Vyukov2014-06-061-1/+2
| | | | llvm-svn: 210351
* tsan: fix out-of-bounds access in Go runtimeDmitry Vyukov2014-06-061-5/+3
| | | | | | FuncEntry can resize the shadow stack, while "thr->shadow_stack_pos[0] = pc" writes out-of-bounds. llvm-svn: 210349
* tsan: fix mapping of meta shadow for GoDmitry Vyukov2014-06-061-8/+18
| | | | | | | Go maps heap and data+bss, these regions are not adjacent. data+bss is mapped first. llvm-svn: 210348
* tsan: flush metamap per-thread cache when thread finishesDmitry Vyukov2014-06-061-0/+1
| | | | llvm-svn: 210347
* tsan: fix clang warning:Dmitry Vyukov2014-06-061-0/+2
| | | | | | comparison of unsigned expression >= 0 is always true llvm-svn: 210346
* tsan: fix Go build with TSAN_COLLECT_STATSDmitry Vyukov2014-06-061-2/+2
| | | | | | Go does not have cur_thread function. llvm-svn: 210345
* [TSan] Reduce the stack frame size of ReportDeadlockAlexey Samsonov2014-06-051-1/+1
| | | | llvm-svn: 210301
* [sanitizer] Make LSan/MSan/TSan honor the "color" flag.Sergey Matveev2014-06-041-2/+2
| | | | | | Based on a patch by Stephan Bergmann. llvm-svn: 210199
* tsan: optimize memory access functionsDmitry Vyukov2014-05-307-76/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The optimization is two-fold: First, the algorithm now uses SSE instructions to handle all 4 shadow slots at once. This makes processing faster. Second, if shadow contains the same access, we do not store the event into trace. This increases effective trace size, that is, tsan can remember up to 10x more previous memory accesses. Perofrmance impact: Before: [ OK ] DISABLED_BENCH.Mop8Read (2461 ms) [ OK ] DISABLED_BENCH.Mop8Write (1836 ms) After: [ OK ] DISABLED_BENCH.Mop8Read (1204 ms) [ OK ] DISABLED_BENCH.Mop8Write (976 ms) But this measures only fast-path. On large real applications the speedup is ~20%. Trace size impact: On app1: Memory accesses : 1163265870 Including same : 791312905 (68%) on app2: Memory accesses : 166875345 Including same : 150449689 (90%) 90% of filtered events means that trace size is effectively 10x larger. llvm-svn: 209897
* tsan: write memory profile in one line (which is much more readable)Dmitry Vyukov2014-05-295-19/+9
| | | | | | | | | | e.g.: RSS 420 MB: shadow:35 meta:231 file:2 mmap:129 trace:19 heap:0 other:0 nthr=1/31 RSS 365 MB: shadow:3 meta:231 file:2 mmap:106 trace:19 heap:0 other:0 nthr=1/31 RSS 429 MB: shadow:23 meta:234 file:2 mmap:143 trace:19 heap:6 other:0 nthr=1/31 RSS 509 MB: shadow:78 meta:241 file:2 mmap:147 trace:19 heap:19 other:0 nthr=1/31 llvm-svn: 209813
* tsan: allow to write memory profile to stdout/stderrDmitry Vyukov2014-05-291-9/+14
| | | | llvm-svn: 209811
* tsan: refactor storage of meta information for heap blocks and sync objectsDmitry Vyukov2014-05-2926-695/+790
| | | | | | | | | | | | | | | The new storage (MetaMap) is based on direct shadow (instead of a hashmap + per-block lists). This solves a number of problems: - eliminates quadratic behaviour in SyncTab::GetAndLock (https://code.google.com/p/thread-sanitizer/issues/detail?id=26) - eliminates contention in SyncTab - eliminates contention in internal allocator during allocation of sync objects - removes a bunch of ad-hoc code in java interface - reduces java shadow from 2x to 1/2x - allows to memorize heap block meta info for Java and Go - allows to cleanup sync object meta info for Go - which in turn enabled deadlock detector for Go llvm-svn: 209810
* tsan: refactor suppressions machineryDmitry Vyukov2014-05-288-43/+41
| | | | | | | | | | The refactoring makes suppressions more flexible and allow to suppress based on arbitrary number of stacks. In particular it fixes: https://code.google.com/p/thread-sanitizer/issues/detail?id=64 "Make it possible to suppress deadlock reports by any stack (not just first)" llvm-svn: 209757
* tsan: do not use 64-bit atomics in allocator codeDmitry Vyukov2014-05-281-8/+4
| | | | | | 64-bit atomics make porting of asan to 32-bits platforms problematic. llvm-svn: 209744
* [tsan] Fix tsango build.Evgeniy Stepanov2014-05-271-0/+4
| | | | llvm-svn: 209658
* [asancov] Write coverage directly to a memory-mapped file.Evgeniy Stepanov2014-05-271-17/+13
| | | | | | | | | | | This way does not require a __sanitizer_cov_dump() call. That's important on Android, where apps can be killed at arbitrary time. We write raw PCs to disk instead of module offsets; we also write memory layout to a separate file. This increases dump size by the factor of 2 on 64-bit systems. llvm-svn: 209653
* [TSan] ifdef out certain functions if 128-bit ints are not supported.Alexey Samsonov2014-05-221-0/+6
| | | | llvm-svn: 209476
* tsan: allow to disable history collectionDmitry Vyukov2014-05-153-14/+32
| | | | | | | The mode is enabled with -DTSAN_NO_HISTORY=1 flag. Intended mostly for research purposes (how fast can it go w/o history). llvm-svn: 208878
* Fix typosAlp Toker2014-05-152-3/+3
| | | | llvm-svn: 208841
* [msan] Better open_memstream support.Evgeniy Stepanov2014-05-131-24/+2
| | | | | | | | Move fflush and fclose interceptors to sanitizer_common. Use a metadata map to keep information about the external locations that must be updated when the file is written to. llvm-svn: 208676
* [tsan] force tls_model='initial-exec' for tsan's cur_thread_placeholder so ↵Kostya Serebryany2014-05-121-0/+1
| | | | | | that we don't depend on the compiler flags llvm-svn: 208536
* [sanitizer] Replace a macro with a function.Evgeniy Stepanov2014-05-071-1/+1
| | | | llvm-svn: 208207
* tsan: disable debug output in normal modeDmitry Vyukov2014-05-051-6/+5
| | | | llvm-svn: 207954
* [sanitizer] Intercept a bunch of stdio calls.Evgeniy Stepanov2014-04-253-66/+17
| | | | | | Add move fopen/freopen interceptors from TSan to common. llvm-svn: 207224
* tsan: allow to suppress all reportsDmitry Vyukov2014-04-254-4/+12
| | | | | | Fixes issue https://code.google.com/p/thread-sanitizer/issues/detail?id=45 llvm-svn: 207218
* tsan: better reports for "unlock of an unlocked mutex"Dmitry Vyukov2014-04-251-3/+6
| | | | llvm-svn: 207211
* tsan: better reports for "read lock of a write locked mutex"Dmitry Vyukov2014-04-253-33/+30
| | | | llvm-svn: 207209
* tsan: improve "read unlock of a write locked mutex" reportDmitry Vyukov2014-04-253-4/+21
| | | | llvm-svn: 207208
* tsan: better report for bad mutex unlocksDmitry Vyukov2014-04-253-11/+19
| | | | | | | + fixes crashes due to races on symbolizer, see https://code.google.com/p/thread-sanitizer/issues/detail?id=55 llvm-svn: 207206
* tsan: better reports for "double lock of a mutex"Dmitry Vyukov2014-04-255-3/+23
| | | | | | | + fixes crashes due to races on symbolizer, see: https://code.google.com/p/thread-sanitizer/issues/detail?id=55 llvm-svn: 207204
* tsan: stop background thread when sandbox is enabledDmitry Vyukov2014-04-244-7/+33
| | | | | | Fixes https://code.google.com/p/thread-sanitizer/issues/detail?id=56 llvm-svn: 207114
* tsan: fix atexit handling after forkDmitry Vyukov2014-04-231-1/+3
| | | | | | fixes issue http://code.google.com/p/thread-sanitizer/issues/detail?id=57 llvm-svn: 206980
* tsan: more precise check for "app memory" in COMPAT modeDmitry Vyukov2014-04-231-0/+7
| | | | | | this fires when a user makes mmap with fixed address (see the test) llvm-svn: 206952
* Move pthread_cond_* interceptors from sanitizer_common with all the ugly ↵Alexey Samsonov2014-04-164-1/+154
| | | | | | hacks to TSan llvm-svn: 206423
* tsan: fix vector clocksDmitry Vyukov2014-04-118-95/+95
| | | | | | | the new optimizations break when thread ids gets reused (clocks go backwards) add the necessary tests as well llvm-svn: 206035
* tsan: ignore interceptors from symbolizerDmitry Vyukov2014-04-111-0/+2
| | | | | | | ocassionally we see races coming from symbolizer interceptors (e.g. memcmp) reproducible only only on large complex programs llvm-svn: 206034
* [TSan] Fix a rare deadlock on multithreaded fork.Alexey Samsonov2014-04-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | If a multi-threaded program calls fork(), TSan ignores all memory accesses in the child to prevent deadlocks in TSan runtime. This is OK, as child is probably going to call exec() as soon as possible. However, a rare deadlocks could be caused by ThreadIgnoreBegin() function itself. ThreadIgnoreBegin() remembers the current stack trace and puts it into the StackDepot to report a warning later if a thread exited with ignores enabled. Using StackDepotPut in a child process is dangerous: it locks a mutex on a slow path, which could be already locked in a parent process. The fix is simple: just don't put current stack traces to StackDepot in ThreadIgnoreBegin() and ThreadIgnoreSyncBegin() functions if we're running after a multithreaded fork. We will not report any "thread exited with ignores enabled" errors in this case anyway. Submitting this without a testcase, as I believe the standalone reproducer is pretty hard to construct. llvm-svn: 205534
* [TSan] Fix a typo ThreadIgnoreSyncEnd. Found by inspectionAlexey Samsonov2014-04-031-1/+1
| | | | llvm-svn: 205531
* [tsan] Remove an accidentally committed debug print.Alexander Potapenko2014-04-011-1/+0
| | | | llvm-svn: 205316
* [TSan] Replace several Printf() calls with Report() to ease debugging.Alexander Potapenko2014-03-311-7/+8
| | | | llvm-svn: 205175
* tsan: fix deadlock during forkDmitry Vyukov2014-03-261-3/+3
| | | | | | ReportRace takes the two mutexes in the opposite order llvm-svn: 204809
* tsan: fix another compiler-injected memsetDmitry Vyukov2014-03-261-1/+2
| | | | | | newer gcc inserts memset here llvm-svn: 204808
* tsan: optimize vector clock operationsDmitry Vyukov2014-03-246-76/+391
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make vector clock operations O(1) for several important classes of use cases. See comments for details. Below are stats from a large server app, 77% of all clock operations are handled as O(1). Clock acquire : 25983645 empty clock : 6288080 fast from release-store : 14917504 contains my tid : 4515743 repeated (fast) : 2141428 full (slow) : 2636633 acquired something : 1426863 Clock release : 2544216 resize : 6241 fast1 : 197693 fast2 : 1016293 fast3 : 2007 full (slow) : 1797488 was acquired : 709227 clear tail : 1 last overflow : 0 Clock release store : 3446946 resize : 200516 fast : 469265 slow : 2977681 clear tail : 0 Clock acquire-release : 820028 llvm-svn: 204656
* tsan: reorder SyncVar members to reduce contentionDmitry Vyukov2014-03-241-2/+4
| | | | llvm-svn: 204655
OpenPOWER on IntegriCloud