summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl
Commit message (Collapse)AuthorAgeFilesLines
...
* tsan: fix trace initialization during thread id reuseDmitry Vyukov2014-12-251-7/+5
| | | | | | | | | The current code leaves the first event in the trace part uninitialized (from the previous thread). It can cause unpredictable behavior during stack/mutexset restoration. Initialize the first event to a fake harmless memory access. llvm-svn: 224834
* tsan: fix styleDmitry Vyukov2014-12-231-3/+2
| | | | | | Usually we roll the variable declaration into the condition in cases like this. llvm-svn: 224755
* [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
* tsan: reset stack0 in the first partition of thread traceDmitry Vyukov2014-12-221-1/+4
| | | | | | | stack0/mset0 contained bogus values from the previous thread that used the same id llvm-svn: 224702
* tsan: fix debugging outputDmitry Vyukov2014-12-221-2/+2
| | | | llvm-svn: 224701
* tsan: add acquire/release functions to java interfaceDmitry Vyukov2014-12-222-0/+38
| | | | | | they are required to handle synchronization on volatile/final fields llvm-svn: 224697
* [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
* tsan: intercept closedirDmitry Vyukov2014-12-191-0/+9
| | | | llvm-svn: 224575
* tsan: disable __tls_get_addr interceptorDmitry Vyukov2014-12-181-0/+10
| | | | | | see the added comments for details, it's messy llvm-svn: 224531
* tsan: fix data races between signal handler and sigactionDmitry Vyukov2014-12-181-17/+32
| | | | | | | signal handler reads sa_sigaction when a concurrent sigaction call can modify it as the result in could try to call SIG_DFL or a partially overwritten function pointer llvm-svn: 224530
* tsan: don't crash with NULL deref during reportingDmitry Vyukov2014-12-181-1/+3
| | | | | | | | tctx==NULL crash observed during deadlock reporting. There seems to be some bugs in the deadlock detector, but it is still useful to be more robust during reporting. llvm-svn: 224508
* tsan: disable flaky debug checkDmitry Vyukov2014-12-181-2/+3
| | | | | | see the comment for details llvm-svn: 224507
* [asan] new flag: hard_rss_limit_mbKostya Serebryany2014-12-162-18/+2
| | | | llvm-svn: 224353
* [Sanitizer] Introduce Allocator::may_return_null bool flag.Alexey Samsonov2014-12-123-7/+13
| | | | | | | | | | | | | | | | | | | | Summary: Turn "allocator_may_return_null" common flag into an Allocator::may_return_null bool flag. We want to make sure that common flags are immutable after initialization. There are cases when we want to change this flag in the allocator at runtime: e.g. in unit tests and during ASan activation on Android. Test Plan: regression test suite, real-life applications Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6623 llvm-svn: 224148
* tsan: don't subtract one from fake PCsDmitry Vyukov2014-12-113-6/+7
| | | | | | | These are fake and not actual PCs, more like function IDs. Pass them to external symbolizer untouched. llvm-svn: 224022
* [tsan] remove TSAN_GO in favor of SANITIZER_GOKostya Serebryany2014-12-0916-92/+92
| | | | llvm-svn: 223732
* [asan] move GetRSS from tsan to sanitizer_commonKostya Serebryany2014-12-094-36/+0
| | | | llvm-svn: 223730
* tsan: protect trace memory range on startupDmitry Vyukov2014-12-051-0/+3
| | | | | | so that user does not map something there ahead of us llvm-svn: 223456
* Replace InternalScopedBuffer<char> with InternalScopedString where applicable.Alexey Samsonov2014-12-021-3/+2
| | | | | | | | | | | | | | | | Summary: No functionality change. Test Plan: make check-all Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6472 llvm-svn: 223164
* Simplify Symbolizer::SymbolizePC() interface.Alexey Samsonov2014-12-027-85/+72
| | | | | | | | | | | 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] Do not flush all streams on exitViktor Kutuzov2014-12-021-6/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D6462 llvm-svn: 223121
* tsan: add description of AcquireGlobal functionDmitry Vyukov2014-11-181-0/+6
| | | | llvm-svn: 222228
* Fix -Wcast-qual warnings in sanitizersAlexey Samsonov2014-11-133-13/+12
| | | | llvm-svn: 221936
* [Sanitizer] Introduce "stack_trace_format" runtime flag.Alexey Samsonov2014-11-064-6/+16
| | | | | | | | | | | | | | | | 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
* [Sanitizer] Introduce generic stack frame rendering machineryAlexey Samsonov2014-11-051-22/+5
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit introduces function __sanitizer::RenderFrame() that allows to render the contents of AddressInfo (essentially, symbolized stack frame) using the custom format string. This function can be used to implement stack frame formatting for both ThreadSanitizer and generic StackTrace::Print(), used in another places. This paves the way towards allowing user to control the format of stack frames, obtaining them in any format he desires, and/or enforcing the consistent output from all sanitizers. Test Plan: compiler-rt test suite Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6140 llvm-svn: 221409
* [TSan] Refactor/simplify ReportLocation structure.Alexey Samsonov2014-11-045-46/+38
| | | | | | | | | | | | # 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
* Correct the usage of DataInfo structure in TSanAlexey Samsonov2014-11-041-0/+1
| | | | llvm-svn: 221297
* [TSan] Make ReportStack contain __sanitizer::AddressInfo object.Alexey Samsonov2014-11-045-65/+58
| | | | | | | | | | 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
* [Sanitizer] Get rid of unnecessary allocations in StripModuleName. NFC.Alexey Samsonov2014-11-041-7/+3
| | | | llvm-svn: 221287
* [TSan] Keep original function and filename in ReportStack.Alexey Samsonov2014-11-042-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | TSan used to do the following transformations with data obtained from the symbolizer: 1) Strip "__interceptor_" prefix from function name. 2) Use "strip_path_prefix" runtime flag to strip filepath. Now these transformations are performed right before the stack trace is printed, and ReportStack structure contains original information. This seems like a right thing to do - stripping is a detail of report formatting implementation, and should belong there. We should, for example, use original path to source file when we apply suppressions. This change also make "strip_path_prefix" flag behavior in TSan consistent with all the other sanitizers - now it should actually match *the prefix* of path, not some substring. E.g. earlier TSan would turn "/usr/lib/libfoo.so" into "libfoo.so" even if strip_path_prefix was "/lib/". Finally, strings obtained from symbolizer come from internal allocator, and "stripping" them early by incrementing a "char*" ensures they can never be properly deallocated, which is a bug. llvm-svn: 221283
* [TSan] Don't strip binary/library name until the moment we print it.Alexey Samsonov2014-11-042-6/+13
| | | | | | | | | | | | | | | This commit changes the place where TSan runtime turns full path to binary or shared library into its basename (/usr/foo/mybinary -> mybinary). Instead of doing it as early as possible (when we obtained the full path from the symbolizer), we now do it as late as possible (right before printing the error report). This seems like a right thing to do - stripping to basename is a detail of report formatting implementation, and should belong there. Also, we might need the full path at some point - for example, to match the suppressions. llvm-svn: 221225
* [TSan] Remove bogus unused global variablesAlexey Samsonov2014-11-031-11/+0
| | | | llvm-svn: 221195
* [TSan] Use StackTrace from sanitizer_common where applicableAlexey Samsonov2014-11-0313-194/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change removes `__tsan::StackTrace` class. There are now three alternatives: # Lightweight `__sanitizer::StackTrace`, which doesn't own a buffer of PCs. It is used in functions that need stack traces in read-only mode, and helps to prevent unnecessary allocations/copies (e.g. for StackTraces fetched from StackDepot). # `__sanitizer::BufferedStackTrace`, which stores buffer of PCs in a constant array. It is used in TraceHeader (non-Go version) # `__tsan::VarSizeStackTrace`, which owns buffer of PCs, dynamically allocated via TSan internal allocator. Test Plan: compiler-rt test suite Reviewers: dvyukov, kcc Reviewed By: kcc Subscribers: llvm-commits, kcc Differential Revision: http://reviews.llvm.org/D6004 llvm-svn: 221194
* [Tsan] Fix references to renamed variables in DPrintf()Viktor Kutuzov2014-10-271-3/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D5993 llvm-svn: 220674
* [Tsan] Make calloc() to not track allocated space unless thread is ↵Viktor Kutuzov2014-10-271-0/+2
| | | | | | | | completely initialized Differential Revision: http://reviews.llvm.org/D5992 llvm-svn: 220673
* [Tsan] Fix guessing data range on FreeBSDViktor Kutuzov2014-10-271-2/+17
| | | | | | Differential Revision: http://reviews.llvm.org/D5990 llvm-svn: 220672
* Change StackDepot interface to use StackTrace more extensivelyAlexey Samsonov2014-10-261-2/+2
| | | | llvm-svn: 220637
* [Sanitizer] Make StackTrace a lightweight reference to array of PCs, andAlexey Samsonov2014-10-264-25/+12
| | | | | | | | | | | | | | | | | | | | | | introduce a BufferedStackTrace class, which owns this array. Summary: This change splits __sanitizer::StackTrace class into a lightweight __sanitizer::StackTrace, which doesn't own array of PCs, and BufferedStackTrace, which owns it. This would allow us to simplify the interface of StackDepot, and eventually merge __sanitizer::StackTrace with __tsan::StackTrace. Test Plan: regression test suite. Reviewers: kcc, dvyukov Reviewed By: dvyukov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5985 llvm-svn: 220635
* tsan: support mmap(MAP_32BIT)Dmitry Vyukov2014-10-246-192/+285
| | | | | | | | | Allow user memory in the first TB of address space. This also enabled non-pie binaries and freebsd. Fixes issue: https://code.google.com/p/thread-sanitizer/issues/detail?id=5 llvm-svn: 220571
* [Tsan] Do not intercept non-FreeBSD functions on FreeBSDViktor Kutuzov2014-10-241-25/+167
| | | | | | Differential Revision: http://reviews.llvm.org/D5858 llvm-svn: 220554
* [tsan] add a stub of another dynamic annotationKostya Serebryany2014-10-221-0/+2
| | | | llvm-svn: 220369
* [Tsan] Add FreeBSD support to longjmp-related definitionsViktor Kutuzov2014-10-212-1/+25
| | | | | | Differential Revision: http://reviews.llvm.org/D5857 llvm-svn: 220292
* [Tsan] Fix sigaction_t to match system definition on FreeBSDViktor Kutuzov2014-10-211-0/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D5856 llvm-svn: 220291
* tsan: fix false positive related to signalsDmitry Vyukov2014-10-153-10/+13
| | | | | | | Write interceptor calls malloc, which causes a false unsafe-call-in-signal-handler report. See the test. llvm-svn: 219784
* tsan: remove dead codeDmitry Vyukov2014-10-151-60/+0
| | | | llvm-svn: 219779
* tsan: remove trailing whitespaceDmitry Vyukov2014-10-141-1/+1
| | | | llvm-svn: 219678
* tsan: refactor atexit handlingDmitry Vyukov2014-10-141-36/+53
| | | | | | | | | | The current handling (manual execution of atexit callbacks) is overly complex and leads to constant problems due to mutual ordering of callbacks. Instead simply wrap callbacks into our wrapper to establish the necessary synchronization. Fixes issue https://code.google.com/p/thread-sanitizer/issues/detail?id=80 llvm-svn: 219675
* tsan: better reporting for virtual-call-after-freeDmitry Vyukov2014-10-134-1/+8
| | | | | | | Previously we said that it's a data race, which is confusing if it happens in the same thread. llvm-svn: 219600
* [Tsan] Do not use INTERCEPT_FUNCTION_VER() on FreeBSDViktor Kutuzov2014-10-101-1/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D5708 llvm-svn: 219483
* [Tsan] Fix references to libc entities in tsan_interceptors.cc on FreeBSDViktor Kutuzov2014-10-091-0/+14
| | | | | | Differential Revision: http://reviews.llvm.org/D5663 llvm-svn: 219395
OpenPOWER on IntegriCloud