summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-082-1/+12
| | | | | | | | | 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-073-36/+58
| | | | | | | | | | | | | | 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-014-13/+11
| | | | | | | | | | | 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: fix windows build scriptDmitry Vyukov2014-06-201-1/+1
| | | | llvm-svn: 211422
* tsan: add Go build script for freebsdDmitry Vyukov2014-06-201-5/+16
| | | | llvm-svn: 211419
* 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
* [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 argument passing in Go interfaceDmitry Vyukov2014-06-061-3/+3
| | | | | | Go calling convention does not support bools (it probably works, but uptrs are safer) llvm-svn: 210365
* 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: allow to build Go runtime with clang + enable SSE3Dmitry Vyukov2014-06-061-5/+7
| | | | llvm-svn: 210344
* [TSan] Reduce the stack frame size of ReportDeadlockAlexey Samsonov2014-06-051-1/+1
| | | | llvm-svn: 210301
* [Deadlock detector] Fix CMake build rules for shared runtimeAlexey Samsonov2014-06-051-12/+9
| | | | llvm-svn: 210232
* [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-309-83/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2933-751/+947
| | | | | | | | | | | | | | | 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] Fix gotsan build.Evgeniy Stepanov2014-05-211-0/+1
| | | | llvm-svn: 209286
* [CMake] Don't build libcxx_tsan with compilers other than ClangAlexey Samsonov2014-05-161-1/+2
| | | | llvm-svn: 209003
* 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-153-4/+4
| | | | llvm-svn: 208841
* [TSan] Build TSan-instrumented version of libcxx and use it in lit tests.Alexey Samsonov2014-05-131-0/+10
| | | | | | | | | | | | | TSan can produce false positives in code that uses C++11 threading, as it doesn't see synchronization inside standard library. See http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-February/035408.html for an example of such case. We may build custom TSan-instrumented version libcxx to fight with that. This change adds build rules for libcxx_tsan and integrates it into testing infrastructure. llvm-svn: 208737
* [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
OpenPOWER on IntegriCloud