summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl
Commit message (Collapse)AuthorAgeFilesLines
...
* sanitizer: new "strict_string_checks" run-time flagDmitry Vyukov2015-04-061-3/+25
| | | | | | | | | | This patch is related to Issue 346: moar string interceptors: strstr, strcasestr, strcspn, strpbrk As was suggested in original review http://reviews.llvm.org/D6056 a new "strict_string_checks" run-time flag introduced. The flag support applied for existing common, asan, msan and tsan interceptors. New asan tests added. Change by Maria Guseva reviewed in http://reviews.llvm.org/D7123 llvm-svn: 234187
* tsan: fix munmap interceptorDmitry Vyukov2015-04-061-2/+5
| | | | | | | | | MetaMap::ResetRange/FreeRange rounds the range up to at least kMetaShadowSize. This is requried for e.g. free(malloc(0)). However, munmap returns EINVAL and do not unmap any memory when length arguments is equal to 0. So don't free meta shadow in this case as well. llvm-svn: 234145
* [Tsan] Do not sanitize memset() and other functions during initializationViktor Kutuzov2015-03-271-3/+9
| | | | | | Differential Revision: http://reviews.llvm.org/D8544 llvm-svn: 233378
* tsan: don't write to meta shadow unnecessarilyDmitry Vyukov2015-03-271-4/+6
| | | | | | | If user does malloc(1<<30), the write to meta shadow can cause excessive memory consumption. llvm-svn: 233373
* [TSan] Disable -Wno-maybe-uninitialized in yet another place.Alexey Samsonov2015-03-241-0/+1
| | | | llvm-svn: 233044
* [libsanitizer] Fix OpenFile() usage in TSan and DFSan.Alexander Potapenko2015-03-231-1/+1
| | | | | | This is a follow-up for r232936. llvm-svn: 232937
* [Tsan] Do not sanitize memcpy() during thread initialization on FreeBSDViktor Kutuzov2015-03-164-5/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D8324 llvm-svn: 232381
* [Tsan] Do not declare std_suppressions when not usedViktor Kutuzov2015-03-121-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D8288 llvm-svn: 232074
* [Tsan] Adjust SA_SIGINFO and SIG_SETMASK values on FreeBSD.Viktor Kutuzov2015-03-121-4/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D8176 llvm-svn: 232073
* tsan: fix a bug in MetaMap::ResetRangeDmitry Vyukov2015-03-121-2/+4
| | | | | | | The bug was uncovered by NegativeTests.MmapTest from data-race-test suite, so port it as well. llvm-svn: 232032
* tsan: fix crash during __tsan_java_moveDmitry Vyukov2015-03-123-2/+62
| | | | | | | | Munmap interceptor did not reset meta shadow for the range, and __tsan_java_move crashed because it encountered non-zero meta shadow for the destination. llvm-svn: 232029
* asan: fix signal handling during stoptheworldDmitry Vyukov2015-03-022-16/+16
| | | | | | | | | | | The problem is that without SA_RESTORER flag, kernel ignores the handler. So tracer actually did not setup any handler. Add SA_RESTORER flag when setting up handlers. Add a test that causes SIGSEGV in stoptheworld callback. Move SignalContext from asan to sanitizer_common to print better diagnostics about signal in the tracer thread. http://reviews.llvm.org/D8005 llvm-svn: 230978
* [Sanitizer] Print column number in SUMMARY line if it's available.Alexey Samsonov2015-02-271-4/+2
| | | | llvm-svn: 230721
* [Sanitizer] Refactor SuppressionContext class.Alexey Samsonov2015-02-204-36/+59
| | | | | | | | | | | | | | SuppressionContext is no longer a singleton, shared by all sanitizers, but a regular class. Each of ASan, LSan, UBSan and TSan now have their own SuppressionContext, which only parses suppressions specific to that sanitizer. "suppressions" flag is moved away from common flags into tool-specific flags, so the user now may pass ASAN_OPTIONS=suppressions=asan_supp.txt LSAN_OPIONS=suppressions=lsan_supp.txt in a single invocation. llvm-svn: 230026
* [TSan][MIPS64] Fix few more test cases for MIPS64Mohit K. Bhakkad2015-02-201-3/+3
| | | | | | | | | | | | Patch by Sagar Thakur Reviewers: dvyukov, samsonov, kcc. Subscribers: dsanders, mohit.bhakkad, Anand.Takale, llvm-commits. Differential Revision: http://reviews.llvm.org/D7290 llvm-svn: 230002
* [TSan][MIPS] Adding support for MIPS64Mohit K. Bhakkad2015-02-206-14/+107
| | | | | | | | | | | | Patch by Sagar Thakur Reviewers: dvyukov, samsonov, petarj, kcc, dsanders. Subscribers: mohit.bhakkad, Anand.Takale, llvm-commits. Differential Revision: http://reviews.llvm.org/D6291 llvm-svn: 229972
* [Sanitizer] Drop LibIgnore dependency on SuppressionContext. NFC.Alexey Samsonov2015-02-191-1/+7
| | | | | | | | Let each LibIgnore user (for now it's only TSan) manually go through SuppressionContext and pass ignored library templates to LibIgnore. llvm-svn: 229924
* Remove support for building sanitizers from Makefile/autoconf build on Linux.Alexey Samsonov2015-02-181-25/+0
| | | | | | | This is a re-application of r229554 restricted to Linux build only. Apple still uses Makefile/autoconf to build Clang and sanitizers. llvm-svn: 229756
* Revert "Remove support for building sanitizers from Makefile/autoconf build."Matthias Braun2015-02-171-0/+25
| | | | | | | | | This reverts commit r229556. Reverting this for now as internal apple builds rely on this functionality. llvm-svn: 229585
* [TSan] Provide default values for compile definitions.Alexey Samsonov2015-02-175-8/+17
| | | | | | | | | Provide defaults for TSAN_COLLECT_STATS and TSAN_NO_HISTORY. Replace #ifdef directives with #if. This fixes a bug introduced in r229112, where building TSan runtime with -DTSAN_COLLECT_STATS=0 would still enable stats collection and reporting. llvm-svn: 229581
* Remove support for building sanitizers from Makefile/autoconf build.Alexey Samsonov2015-02-171-25/+0
| | | | | | | | They autotools build has a number of missing features, supports less OS, architectures, build configurations, doesn't have any tests and is hard to support in sync with CMake build. llvm-svn: 229556
* tsan: remove everything related to rss/background thread in Go modeDmitry Vyukov2015-02-162-8/+4
| | | | | | | | | In Go mode the background thread is not started (internal_thread_start is empty). There is no sense in having this code compiled in. Also removes dependency on sanitizer_linux_libcdep.cc which is good, ideally Go runtime does not depend on libc at all. llvm-svn: 229396
* tsan: fix shadow memory mapping on windowsDmitry Vyukov2015-02-162-8/+8
| | | | llvm-svn: 229391
* tsan: fix buildDmitry Vyukov2015-02-142-7/+12
| | | | | | | | | | Revision 229127 introduced a bug: zero value is not OK for trace headers, because stack0 needs constructor call. Instead unmap the unused part of trace after all ctors have been executed. llvm-svn: 229263
* tsan: always subtract one from program countersDmitry Vyukov2015-02-141-6/+0
| | | | | | | | Go has a pending change to pass proper PCs to tsan: https://go-review.googlesource.com/#/c/4902/ So now we can always subtract one from PCs. llvm-svn: 229262
* tsan: don't initialize trace header in release modeDmitry Vyukov2015-02-131-0/+6
| | | | | | | | | | | | | We are going to use only a small part of the trace with the default value of history_size. However, the constructor writes to the whole trace. It writes mostly zeros, so freshly mmaped memory will do. The only non-zero field if mutex type used for debugging. Reduces per-goroutine overhead by 8K. https://code.google.com/p/thread-sanitizer/issues/detail?id=89 llvm-svn: 229127
* tsan: fix buildDmitry Vyukov2015-02-132-9/+2
| | | | llvm-svn: 229120
* tsan: reduce history size in Go modeDmitry Vyukov2015-02-132-3/+3
| | | | | | | | | | | | The ContainsSameAccess optimization substantially reduces pressure on trace by eliminating duplicate accesses. So now we can reduce default trace size to reduce per-goroutine memory consumption. Current default size is 64K events, new -- 32K events. In either case user can change it with GORACE env var. Reduces per-goroutine memory consumption from 356K to 226K. llvm-svn: 229117
* tsan: disable deadlock detector in Go modeDmitry Vyukov2015-02-131-0/+2
| | | | | | | Go does not use that. https://code.google.com/p/thread-sanitizer/issues/detail?id=89 llvm-svn: 229116
* tsan: remove internal deadlock detector from ThreadState in Go modeDmitry Vyukov2015-02-131-0/+2
| | | | | | | Go does not use that. https://code.google.com/p/thread-sanitizer/issues/detail?id=89 llvm-svn: 229115
* tsan: reduce size of vector clock in Go modeDmitry Vyukov2015-02-131-0/+4
| | | | | | | | | Go does not have freed memory. Reduces per-goroutine overhead from 455K to 356K. https://code.google.com/p/thread-sanitizer/issues/detail?id=89 llvm-svn: 229113
* tsan: remove stats from ThreadState ifndef TSAN_COLLECT_STATSDmitry Vyukov2015-02-135-6/+18
| | | | | | | Issue 89: Uses a lot of memory for each goroutine https://code.google.com/p/thread-sanitizer/issues/detail?id=89 llvm-svn: 229112
* tsan: fix stack printingDmitry Vyukov2015-02-131-2/+3
| | | | | | strip_path_prefix was not stripped from file names. llvm-svn: 229106
* [ASan] Add use_madv_dontdump flag.Yury Gribov2015-02-032-0/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D7294 llvm-svn: 227959
* [Sanitizers] Introduce GET_LINK_MAP_BY_DLOPEN_HANDLE() macroViktor Kutuzov2015-01-301-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D7233 llvm-svn: 227570
* tsan: properly instrument unaligned accessesDmitry Vyukov2015-01-272-30/+56
| | | | | | | | | | | If a memory access is unaligned, emit __tsan_unaligned_read/write callbacks instead of __tsan_read/write. Required to change semantics of __tsan_unaligned_read/write to not do the user memory. But since they were unused (other than through __sanitizer_unaligned_load/store) this is fine. Fixes long standing issue 17: https://code.google.com/p/thread-sanitizer/issues/detail?id=17 llvm-svn: 227230
* tsan: use hacky call only on x86_64Dmitry Vyukov2015-01-221-1/+1
| | | | | | required for mips64 and aarch64 ports llvm-svn: 226829
* [Sanitizers] Intercept opendir()Viktor Kutuzov2015-01-211-9/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D6968 llvm-svn: 226648
* tsan: don't unroll memory access loop in debug modeDmitry Vyukov2015-01-211-0/+11
| | | | | | | | | MemoryAccess function consumes ~4K of stack in debug mode, in significant part due to the unrolled loop. And gtest gives only 4K of stack to death test threads, which causes stack overflows in debug mode. llvm-svn: 226644
* [asan] use MADV_NOHUGEPAGE for shadow to reduce the actual memory usageKostya Serebryany2015-01-211-4/+3
| | | | llvm-svn: 226636
* [asan] Allow changing verbosity in activation flags.Evgeniy Stepanov2015-01-202-3/+4
| | | | | | | This change removes some debug output in asan_flags.cc that was reading the verbosity level before all the flags were parsed. llvm-svn: 226566
* tsan: remove TSAN_SHADOW_COUNTDmitry Vyukov2015-01-192-74/+7
| | | | | | | | | TSAN_SHADOW_COUNT is defined to 4 in all environments. Other values of TSAN_SHADOW_COUNT were never tested and were broken by recent changes to shadow mapping. Remove it as there is no reason to fix nor maintain it. llvm-svn: 226466
* [sanitizer] Make unrecognized flags not fatal.Evgeniy Stepanov2015-01-191-2/+3
| | | | | | Print a warning at verbosity=1 and higher instead of dying immediately. llvm-svn: 226458
* [sanitizer] Flag parser rewrite.Evgeniy Stepanov2015-01-151-10/+11
| | | | | | | The new parser is a lot stricter about syntax, reports unrecognized flags, and will make it easier to implemented some of the planned features. llvm-svn: 226169
* Fix two extra semicolon warningsEhsan Akhgari2015-01-121-1/+1
| | | | | | | | | | Reviewers: timurrrr Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6890 llvm-svn: 225635
* [Sanitizer] Change the runtime flag representation.Alexey Samsonov2015-01-073-115/+100
| | | | | | | | | | | This mirrors r225239 to all the rest sanitizers: ASan, DFSan, LSan, MSan, TSan, UBSan. Now the runtime flag type, name, default value and description is located in the single place in the .inc file. llvm-svn: 225327
* Remove TSAN_DEBUG in favor of SANITIZER_DEBUG.Alexey Samsonov2015-01-037-21/+17
| | | | llvm-svn: 225111
* Replace DCHECK with DCHECK_LE where appropriate.Alexey Samsonov2015-01-031-4/+4
| | | | llvm-svn: 225110
* Revert "Revert r224736: "[Sanitizer] Make CommonFlags immutable after ↵Alexey Samsonov2015-01-021-7/+12
| | | | | | | | | | | | | | | | initialization."" Fix test failures by introducing CommonFlags::CopyFrom() to make sure compiler doesn't insert memcpy() calls into runtime code. Original commit message: Protect CommonFlags singleton by adding const qualifier to common_flags() accessor. The only ways to modify the flags are SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and OverrideCommonFlags() functions, which are only supposed to be called during initialization. llvm-svn: 225088
* Revert r224736: "[Sanitizer] Make CommonFlags immutable after initialization."Chandler Carruth2015-01-021-11/+7
| | | | | | | | | | We've got some internal users that either aren't compatible with this or have found a bug with it. Either way, this is an isolated cleanup and so I'm reverting it to un-block folks while we investigate. Alexey and I will be working on fixing everything up so this can be re-committed soon. Sorry for the noise and any inconvenience. llvm-svn: 225079
OpenPOWER on IntegriCloud