summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl/tsan_flags.cc
Commit message (Collapse)AuthorAgeFilesLines
* compiler-rt: Rename .cc file in lib/tsan/rtl to .cppNico Weber2019-08-011-125/+0
| | | | | | Like r367463, but for tsan/rtl. llvm-svn: 367564
* Improve error message when '=' is missing in {ASAN,...}_OPTIONS.Vitaly Buka2019-06-151-3/+3
| | | | | | | | | | | | | | | | | | Summary: It's handling isses as described here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89832 Patch by Martin Liška. Reviewers: kcc, vitalybuka Reviewed By: vitalybuka Subscribers: cryptoad, kubamracek Differential Revision: https://reviews.llvm.org/D59876 llvm-svn: 363480
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* tsan: align default value of detect_deadlocks flag with actual behaviorDmitry Vyukov2018-12-191-2/+1
| | | | | | | | | | | | | | I tricked myself into thinking that deadlock detection is off by default in TSan by looking at the default value of the detect_deadlocks flag and outdated docs. (Created a pull request to update docs.) I even managed to confuse others: https://groups.google.com/forum/#!topic/thread-sanitizer/xYvnAYwtoDk However, the default value is overwritten in code (TSan_flags.cc:InitializeFlags). The TSan/deadlock tests also rely on this This changes aligns the default value of the flag with the actual default behavior. Author: yln (Julian Lettner) Reviewed in: https://reviews.llvm.org/D55846 llvm-svn: 349609
* tsan: add new mutex annotationsDmitry Vyukov2017-03-261-4/+0
| | | | | | | | | | | | | | There are several problems with the current annotations (AnnotateRWLockCreate and friends): - they don't fully support deadlock detection (we need a hook _before_ mutex lock) - they don't support insertion of random artificial delays to perturb execution (again we need a hook _before_ mutex lock) - they don't support setting extended mutex attributes like read/write reentrancy (only "linker init" was bolted on) - they don't support setting mutex attributes if a mutex don't have a "constructor" (e.g. static, Java, Go mutexes) - they don't ignore synchronization inside of lock/unlock operations which leads to slowdown and false negatives The new annotations solve of the above problems. See tsan_interface.h for the interface specification and comments. Reviewed in https://reviews.llvm.org/D31093 llvm-svn: 298809
* tsan: always define SANITIZER_GODmitry Vyukov2016-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | Currently we either define SANITIZER_GO for Go or don't define it at all for C++. This works fine with preprocessor (ifdef/ifndef/defined), but does not work for C++ if statements (e.g. if (SANITIZER_GO) {...}). Also this is different from majority of SANITIZER_FOO macros which are always defined to either 0 or 1. Always define SANITIZER_GO to either 0 or 1. This allows to use SANITIZER_GO in expressions and in flag default values. Also remove kGoMode and kCppMode, which were meant to be used in expressions, but they are not defined in sanitizer_common code, so SANITIZER_GO become prevalent. Also convert some preprocessor checks to C++ if's or ternary expressions. Majority of this change is done mechanically with: sed "s#ifdef SANITIZER_GO#if SANITIZER_GO#g" sed "s#ifndef SANITIZER_GO#if \!SANITIZER_GO#g" sed "s#defined(SANITIZER_GO)#SANITIZER_GO#g" llvm-svn: 285443
* tsan: clean up dynamic TLS memory between reuseDmitry Vyukov2016-06-021-0/+1
| | | | | | | | | | | | | Currently the added test produces false race reports with glibc 2.19, because DLTS memory is reused by pthread under the hood. Use the DTLS machinery to intercept new DTLS ranges. __tls_get_addr known to cause issues for tsan in the past, so write the interceptor more carefully. Reviewed in http://reviews.llvm.org/D20927 llvm-svn: 271568
* [sancov] common flags initialization.Mike Aizatsky2016-03-181-1/+1
| | | | | | | | | | | | Summary: Introducing InitializeCommonFlags accross all sanitizers to simplify common flags management. Setting coverage=1 when html_cov_report is requested. Differential Revision: http://reviews.llvm.org/D18273 llvm-svn: 263820
* [tsan] Fix weakly imported functions on OS XKuba Brecka2015-11-301-2/+2
| | | | | | | | | | On OS X, for weak function (that user can override by providing their own implementation in the main binary), we need extern `"C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE NOINLINE`. Fixes a broken test case on OS X, java_symbolization.cc, which uses a weak function __tsan_symbolize_external. Differential Revision: http://reviews.llvm.org/D14907 llvm-svn: 254298
* tsan: replace macro check with constant checkDmitry Vyukov2015-11-161-7/+7
| | | | | | As per comments in 252892 commit. llvm-svn: 253216
* tsan: disable abort_on_error for GoDmitry Vyukov2015-11-121-1/+5
| | | | | | | It does not work as expected. Go runtime handles SIGABRT and crashes with a loud message. llvm-svn: 252892
* [Sanitizers] Unify the semantics and usage of "exitcode" runtime flag across ↵Alexey Samsonov2015-08-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | all sanitizers. Summary: Merge "exitcode" flag from ASan, LSan, TSan and "exit_code" from MSan into one entity. Additionally, make sure sanitizer_common now uses the value of common_flags()->exitcode when dying on error, so that this flag will automatically work for other sanitizers (UBSan and DFSan) as well. User-visible changes: * "exit_code" MSan runtime flag is now deprecated. If explicitly specified, this flag will take precedence over "exitcode". The users are encouraged to migrate to the new version. * __asan_set_error_exit_code() and __msan_set_exit_code() functions are removed. With few exceptions, we don't support changing runtime flags during program execution - we can't make them thread-safe. The users should use __sanitizer_set_death_callback() that would call _exit() with proper exit code instead. * Plugin tools (LSan and UBSan) now inherit the exit code of the parent tool. In particular, this means that ASan would now crash the program with exit code "1" instead of "23" if it detects leaks. Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12120 llvm-svn: 245734
* Allow UBSan+MSan and UBSan+TSan combinations (Clang part).Alexey Samsonov2015-04-281-6/+23
| | | | | | | | Embed UBSan runtime into TSan and MSan runtimes in the same as we do in ASan. Extend UBSan test suite to also run tests for these combinations. llvm-svn: 235954
* tsan: fix parsing of second_deadlock_stack flagDmitry Vyukov2015-04-141-0/+4
| | | | | | | It was broken during flag parsing refactoring. Enable test for the flag. llvm-svn: 234878
* 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
* [asan] Allow changing verbosity in activation flags.Evgeniy Stepanov2015-01-201-1/+3
| | | | | | | 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
* [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
* [Sanitizer] Change the runtime flag representation.Alexey Samsonov2015-01-071-56/+16
| | | | | | | | | | | 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
* 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
* [Sanitizer] Make CommonFlags immutable after initialization.Alexey Samsonov2014-12-221-7/+11
| | | | | | | | | | | | | | | | | | | Summary: 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. Test Plan: regression test suite Reviewers: kcc, eugenis, glider Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6741 llvm-svn: 224736
* [Sanitizer] Refactor CommonFlags interface. NFC.Alexey Samsonov2014-12-191-3/+3
| | | | | | | | | | Add CommonFlags::SetDefaults() and CommonFlags::ParseFromString(), so that this object can be easily tested. Enforce that ParseCommonFlagsFromString() and SetCommonFlagsDefaults() work only with singleton CommonFlags, shared across all sanitizer runtimes. llvm-svn: 224617
* [Sanitizer] Introduce "stack_trace_format" runtime flag.Alexey Samsonov2014-11-061-0/+1
| | | | | | | | | | | | | | | | This flag can be used to specify the format of stack frames - user can now provide a string with placeholders, which should be printed for each stack frame with placeholders replaced with actual data. For example "%p" will be replaced by PC, "%s" will be replaced by the source file name etc. "DEFAULT" value enforces default stack trace format currently used in all the sanitizers except TSan. This change also implements __sanitizer_print_stack_trace interface function in TSan. llvm-svn: 221469
* [TSan] Use common flags in the same way as all the other sanitizersAlexey Samsonov2014-09-101-10/+8
| | | | llvm-svn: 217559
* tsan: allocate vector clocks using slab allocatorDmitry Vyukov2014-08-051-1/+1
| | | | | | | | | | 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] Make "suppressions" and "print_suppressions" common runtime flags.Alexey Samsonov2014-07-301-4/+1
| | | | | | No functionality change. llvm-svn: 214343
* tsan: remove special handling of false reports coming from JVMDmitry Vyukov2014-07-151-2/+0
| | | | | | There is now a more common functionality in the form of called_from_lib suppressions. llvm-svn: 213057
* [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: better reports for "double lock of a mutex"Dmitry Vyukov2014-04-251-0/+2
| | | | | | | + fixes crashes due to races on symbolizer, see: https://code.google.com/p/thread-sanitizer/issues/detail?id=55 llvm-svn: 207204
* [libsanitizer] Introduce flag descriptions.Alexander Potapenko2014-03-201-26/+28
| | | | | | | | | Extend ParseFlag to accept the |description| parameter, add dummy values for all existing flags. As the flags are parsed their descriptions are stored in a global linked list. The tool can later call __sanitizer::PrintFlagDescriptions() to dump all the flag names and their descriptions. Add the 'help' flag and make ASan, TSan and MSan print the flags if 'help' is set to 1. llvm-svn: 204339
* tsan: deobfuscate global ctx variableDmitry Vyukov2014-03-201-1/+1
| | | | llvm-svn: 204327
* tsan: deadlock detector: add deadlock detector flagsDmitry Vyukov2014-03-181-0/+6
| | | | | | the first flags is to enable printing of the second stack per edge llvm-svn: 204150
* [Sanitizer] Teach external symbolizer to work with addr2line if ↵Alexey Samsonov2014-02-121-0/+2
| | | | | | llvm-symbolizer is unavailable. Allow this mode in TSan. llvm-svn: 201218
* tsan: add SANITIZER_INTERFACE_ATTRIBUTE to more callbacksDmitry Vyukov2014-02-041-1/+2
| | | | | | so that it's possible to override them from a dynamic library. llvm-svn: 200747
* tsan: do not deadlock on forkDmitry Vyukov2014-01-241-0/+2
| | | | | | | | | | | | | Currently correct programs can deadlock after fork, because atomic operations and async-signal-safe calls are not async-signal-safe under tsan. With this change: - if a single-threaded program forks, the child continues running with verification enabled (the tsan background thread is recreated as well) - if a multi-threaded program forks, then the child runs with verification disabled (memory accesses, atomic operations and interceptors are disabled); it's expected that it will exec soon anyway - if the child tries to create more threads after multi-threaded fork, the program aborts with error message - die_after_fork flag is added that allows to continue running, but all bets are off http://llvm-reviews.chandlerc.com/D2614 llvm-svn: 199993
* [TSan] Replace __tsan::OverrideFlags with __tsan::OnInitializeAlexey Samsonov2013-12-111-5/+0
| | | | llvm-svn: 197014
* tsan: fix flags parsingDmitry Vyukov2013-11-271-6/+7
| | | | | | | | - running_on_valgrind was not parsed in some contexts - refactor code a bit - add comprehensive tests for flags parsing llvm-svn: 195831
* [Sanitizer] Specify a default value for each common runtime flagAlexey Samsonov2013-11-121-11/+6
| | | | llvm-svn: 194479
* tsan: add a test for __tsan_default_options()Dmitry Vyukov2013-10-171-8/+0
| | | | llvm-svn: 192873
* 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. llvm-svn: 192715
* tsan: move verbosity flag to CommonFlagsDmitry Vyukov2013-10-151-6/+7
| | | | llvm-svn: 192701
* tsan: use sanitizer::CommonFlags in tsanDmitry Vyukov2013-10-151-10/+7
| | | | llvm-svn: 192692
* Refactor the usage of strip_path_prefix option and make it more consistent ↵Alexey Samsonov2013-10-041-0/+1
| | | | | | across sanitizers llvm-svn: 191943
* tsan: add memory_limit_mb flagDmitry Vyukov2013-10-031-0/+2
| | | | | | | The flag allows to bound maximum process memory consumption (best effort). If RSS reaches memory_limit_mb, tsan flushes all shadow memory. llvm-svn: 191913
* tsan: support allocator_may_return_null flagDmitry Vyukov2013-09-271-0/+4
| | | | | | Fixes https://code.google.com/p/thread-sanitizer/issues/detail?id=29 llvm-svn: 191482
* tsan/msan: add halt_on_error flagDmitry Vyukov2013-08-131-0/+2
| | | | | | If halt_on_error==true, program terminates after reporting first error. llvm-svn: 188279
* tsan: print statistics about benign race annotationsDmitry Vyukov2013-03-281-0/+2
| | | | | | | (total count, unique, matched) if requested with print_benign=1 flag. llvm-svn: 178245
* tsan: print matched suppressions if print_suppressions=1 flag is providedDmitry Vyukov2013-03-271-0/+2
| | | | llvm-svn: 178159
* tsan: add flag to control symbolizer flush frequencyDmitry Vyukov2013-03-211-0/+2
| | | | llvm-svn: 177638
OpenPOWER on IntegriCloud