summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl/tsan_suppressions.cc
Commit message (Collapse)AuthorAgeFilesLines
* compiler-rt: Rename .cc file in lib/tsan/rtl to .cppNico Weber2019-08-011-161/+0
| | | | | | Like r367463, but for tsan/rtl. llvm-svn: 367564
* 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] Use switches when dealing with enumsJulian Lettner2019-01-161-32/+24
| | | | | | | | | | | | | | | | | | Summary: Small refactoring: replace some if-else cascades with switches so that the compiler warns us about missing cases. Maybe found a small bug? Reviewers: dcoughlin, kubamracek, dvyukov, delcypher, jfb Reviewed By: dvyukov Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D56295 llvm-svn: 351288
* [sanitizer] Remove reserving constructor from InternalMmapVectorVitaly Buka2018-05-071-1/+1
| | | | llvm-svn: 331617
* [tsan] Provide API for libraries for race detection on custom objectsKuba Mracek2017-02-021-0/+2
| | | | | | | | This patch allows a non-instrumented library to call into TSan runtime, and tell us about "readonly" and "modifying" accesses to an arbitrary "object" and provide the caller and tag (type of object). This allows TSan to detect violations of API threading contracts where "read-only" methods can be called simulatenously from multiple threads, while modifying methods must be exclusive. Differential Revision: https://reviews.llvm.org/D28836 llvm-svn: 293885
* tsan: always define SANITIZER_GODmitry Vyukov2016-10-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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] Detect uses of uninitialized, destroyed and invalid mutexesKuba Brecka2016-03-161-0/+2
| | | | | | | | This patch adds a new TSan report type, ReportTypeMutexInvalidAccess, which is triggered when pthread_mutex_lock or pthread_mutex_unlock returns EINVAL (this means the mutex is invalid, uninitialized or already destroyed). Differential Revision: http://reviews.llvm.org/D18132 llvm-svn: 263641
* Change comma to semi-colon, no functionality change.Richard Trieu2016-02-181-1/+1
| | | | | | Cleanup for upcoming Clang warning -Wcomma. llvm-svn: 261269
* [TSan] Fix PrintMatchedSuppressions: Read hit count for suppression atomicallyMohit K. Bhakkad2016-02-041-2/+2
| | | | | | | | Reviewers: dvyukov. Subscribers: jaydeep, sagar, dsanders, llvm-commits. Differential Revision: http://reviews.llvm.org/D16845 llvm-svn: 259755
* [tsan] Fix weakly imported functions on OS XKuba Brecka2015-11-301-1/+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: speed up race deduplicationDmitry Vyukov2015-09-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | Race deduplication code proved to be a performance bottleneck in the past if suppressions/annotations are used, or just some races left unaddressed. And we still get user complaints about this: https://groups.google.com/forum/#!topic/thread-sanitizer/hB0WyiTI4e4 ReportRace already has several layers of caching for racy pcs/addresses to make deduplication faster. However, ReportRace still takes a global mutex (ThreadRegistry and ReportMutex) during deduplication and also calls mmap/munmap (which take process-wide semaphore in kernel), this makes deduplication non-scalable. This patch moves race deduplication outside of global mutexes and also removes all mmap/munmap calls. As the result, race_stress.cc with 100 threads and 10000 iterations become 30x faster: before: real 0m21.673s user 0m5.932s sys 0m34.885s after: real 0m0.720s user 0m23.646s sys 0m1.254s http://reviews.llvm.org/D12554 llvm-svn: 246758
* tsan: implement suppressions for top frame onlyDmitry Vyukov2015-06-291-13/+21
| | | | | | | | | | The new suppression type is called "race_top" and is matched only against top frame in report stacks. This is required for situations when we want to suppress a race in a "thread pool" or "event loop" implementation. If we simply use "race:ThreadPool::Execute" suppression, that can suppress everything in the program. Reviewed in http://reviews.llvm.org/D10686 llvm-svn: 240949
* [Tsan] Do not declare std_suppressions when not usedViktor Kutuzov2015-03-121-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D8288 llvm-svn: 232074
* [Sanitizer] Refactor SuppressionContext class.Alexey Samsonov2015-02-201-34/+47
| | | | | | | | | | | | | | 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] remove TSAN_GO in favor of SANITIZER_GOKostya Serebryany2014-12-091-2/+2
| | | | llvm-svn: 223732
* Simplify Symbolizer::SymbolizePC() interface.Alexey Samsonov2014-12-021-1/+2
| | | | | | | | | | | Return a linked list of AddressInfo objects, instead of using an array of these objects as an output parameter. This simplifies the code in callers of this function (especially TSan). Fix a few memory leaks from internal allocator, when the returned AddressInfo objects were not properly cleared. llvm-svn: 223145
* [TSan] Refactor/simplify ReportLocation structure.Alexey Samsonov2014-11-041-4/+4
| | | | | | | | | | | | # Make DataInfo (describing a global) a member of ReportLocation to avoid unnecessary copies and allocations. # Introduce a constructor and a factory method, so that all structure users don't have to go to internal allocator directly. # Remove unused fields (file/line). No functionality change. llvm-svn: 221302
* [TSan] Make ReportStack contain __sanitizer::AddressInfo object.Alexey Samsonov2014-11-041-4/+5
| | | | | | | | | | AddressInfo contains the results of symbolization. Store this object directly in the symbolized stack, instead of copying data around and making unnecessary memory allocations. No functionality change. llvm-svn: 221294
* tsan: better reporting for virtual-call-after-freeDmitry Vyukov2014-10-131-0/+2
| | | | | | | Previously we said that it's a data race, which is confusing if it happens in the same thread. llvm-svn: 219600
* [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
* [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 SuppressionContext a singleton class, residing in ↵Alexey Samsonov2014-07-301-24/+14
| | | | | | | | | | 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: refactor suppressions machineryDmitry Vyukov2014-05-281-2/+3
| | | | | | | | | | 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: allow to suppress all reportsDmitry Vyukov2014-04-251-0/+8
| | | | | | Fixes issue https://code.google.com/p/thread-sanitizer/issues/detail?id=45 llvm-svn: 207218
* [sanitizer] deadlock detector: a) initial support for suppressions, b) be ↵Kostya Serebryany2014-03-191-0/+2
| | | | | | more robust in case we failed to extract a stack trace for one of the locks llvm-svn: 204225
* tsan: ignore interceptors coming from specified librariesDmitry Vyukov2013-10-031-0/+5
| | | | | | | | | | | | | LibIgnore allows to ignore all interceptors called from a particular set of dynamic libraries. LibIgnore remembers all "called_from_lib" suppressions from the provided SuppressionContext; finds code ranges for the libraries; and checks whether the provided PC value belongs to the code ranges. Also make malloc and friends interceptors use SCOPED_INTERCEPTOR_RAW instead of SCOPED_TSAN_INTERCEPTOR, because if they are called from an ignored lib, then must call our internal allocator instead of libc malloc. llvm-svn: 191897
* [TSan] fixup for r189791: don't put ; on the newlineAlexey Samsonov2013-09-031-3/+1
| | | | llvm-svn: 189792
* tsan: add suppressions for true/false positives in standard librariesDmitry Vyukov2013-09-031-0/+14
| | | | llvm-svn: 189791
* [TSan] Let the users suppress use-after-free errors using the "race:" ↵Alexander Potapenko2013-08-071-1/+1
| | | | | | | | | | | | | | | suppressions. If there's a race between a memory access and a free() call in the client program, it can be reported as a use-after-free (if the access occurs after the free()) or an ordinary race (if free() occurs after the access). We've decided to use a single "race:" prefix for both cases instead of introducing a "use-after-free:" one, because in many cases this allows us to keep a single suppression for both the use-after-free and free-after-use. This may be misleading if the use-after-free occurs in a non-racy way (e.g. in a single-threaded program). But normally such bugs shall not be suppressed. llvm-svn: 187885
* [tsan] Fix build.Sergey Matveev2013-06-261-1/+1
| | | | llvm-svn: 184963
* [tsan] Move some suppressions-related code to common.Sergey Matveev2013-06-261-122/+39
| | | | | | Factor out code to be reused in LSan. Also switch from linked list to vector. llvm-svn: 184957
* tsan: allows to suppress races on global variablesDmitry Vyukov2013-06-101-12/+38
| | | | llvm-svn: 183672
* tsan: match "race" suppressions against "race on vptr" reportsDmitry Vyukov2013-05-291-1/+7
| | | | llvm-svn: 182842
* [nolibc] Move all platforms to internal_getpid.Peter Collingbourne2013-05-171-1/+1
| | | | | | | | | | Before, we had an unused internal_getpid function for Linux, and a platform-independent GetPid function. To make the naming conventions consistent for syscall-like functions, the GetPid syscall wrapper in sanitizer_posix.cc is moved to sanitizer_mac.cc, and GetPid is renamed to internal_getpid, bringing the Linux variant into use. llvm-svn: 182132
* [nolibc] Change internal syscall API to remove reliance on libc's errno.Peter Collingbourne2013-05-081-2/+3
| | | | | | | | | | | | | This change moves to a model where the error value of a system call is potentially contained in the return value itself rather than being implicit in errno. The helper function internal_iserror can be used to extract the error value from a return value. On platforms other than Linux/x86_64 this still uses errno, but other platforms are free to port their error handling to this new model. Differential Revision: http://llvm-reviews.chandlerc.com/D756 llvm-svn: 181436
* tsan: print matched suppressions if print_suppressions=1 flag is providedDmitry Vyukov2013-03-271-1/+30
| | | | llvm-svn: 178159
* tsan: fix bug in suppression reading (suppressions from file were discarded)Dmitry Vyukov2013-02-141-1/+1
| | | | llvm-svn: 175153
* [Sanitizer] make internal_open have the same interface as libc versionAlexey Samsonov2013-02-011-1/+1
| | | | llvm-svn: 174187
* tsan: allow a front-end to provide default suppressionsDmitry Vyukov2013-01-241-5/+16
| | | | llvm-svn: 173345
* tsan: check if PWD env var is absentDmitry Vyukov2012-12-041-1/+1
| | | | | | | On some programs I see: failed to open suppressions file '<null>/testing/tsan/v2/tsan.supp' llvm-svn: 169230
* [TSan] finally remove TsanPrintf in favor of Printf from sanitizer_commonAlexey Samsonov2012-11-021-4/+4
| | | | llvm-svn: 167294
* tsan: cache pc's that cause suppressions (this way we do not need to ↵Dmitry Vyukov2012-10-051-5/+5
| | | | | | symbolize the reports) llvm-svn: 165317
* [Sanitizer] Remove implicit conversion of InternalScopedBuffer<T> to T*Alexey Samsonov2012-09-051-3/+3
| | | | llvm-svn: 163197
* [TSan] switch tsan to using InternalScopedBuffer from sanitizer_commonAlexey Samsonov2012-08-221-6/+6
| | | | llvm-svn: 162351
* tsan: prevent insertion of unwanted memset/memcpy/memcmp into runtimeDmitry Vyukov2012-06-271-6/+6
| | | | llvm-svn: 159294
* [Sanitizer] Renaming: SNPrintf -> internal_snprintf (and move it to ↵Alexey Samsonov2012-06-191-2/+2
| | | | | | sanitizer libc) llvm-svn: 158710
* [Sanitizer] move different wrappers from TSan to common sanitizer runtimeAlexey Samsonov2012-06-181-1/+2
| | | | llvm-svn: 158655
* [Sanitizer] Use DEFINE_REAL macro in TSan runtime to call libc ↵Alexey Samsonov2012-06-151-6/+6
| | | | | | implementations of functions. Move strchr to sanitizer_libc. llvm-svn: 158517
* [TSan] use efficient real_memcpy inside runtimeAlexey Samsonov2012-06-091-1/+1
| | | | llvm-svn: 158260
* [TSan] run some renaming as a preparation for factoring out Printf ↵Alexey Samsonov2012-06-061-6/+6
| | | | | | implementation. llvm-svn: 158058
OpenPOWER on IntegriCloud