summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/tsan/test.h
Commit message (Collapse)AuthorAgeFilesLines
* [TSan] Add AnnotateIgnoreReadsBegin declaration to tsan/test.hJulian Lettner2019-09-091-0/+5
| | | | | | | | | | | | Declare the family of AnnotateIgnore[Read,Write][Begin,End] TSan annotations in compiler-rt/test/tsan/test.h so that we don't have to declare them separately in every test that needs them. Replace usages. Leave usages that explicitly test the annotation mechanism: thread_end_with_ignore.cpp thread_end_with_ignore3.cpp llvm-svn: 371446
* [TSan] Support fiber API on macOSJulian Lettner2019-04-201-0/+6
| | | | | | | | | | | | | | Committing on behalf of Yuri Per (yuri). Reviewers: dvyukov, kubamracek, yln Reviewed By: kubamracek Authored By: yuri Differential Revision: https://reviews.llvm.org/D58110 llvm-svn: 358802
* [tsan] Fix a failure in test java_race_pc on AArch64 after r333071Igor Kudrin2018-05-241-1/+1
| | | | llvm-svn: 333180
* [tsan] Include __tsan_external_* API from a header file instead of declaring ↵Kuba Mracek2017-04-241-0/+2
| | | | | | | | them manually. NFC. Differential Revision: https://reviews.llvm.org/D32384 llvm-svn: 301190
* [tsan] Add support for C++ exceptions into TSan (call __tsan_func_exit ↵Kuba Brecka2016-11-141-0/+1
| | | | | | | | | | during unwinding), compiler-rt part This adds support for TSan C++ exception handling, where we need to add extra calls to __tsan_func_exit when a function is exitted via exception mechanisms. Otherwise the shadow stack gets corrupted (leaked). This patch moves and enhances the existing implementation of EscapeEnumerator that finds all possible function exit points, and adds extra EH cleanup blocks where needed. Differential Revision: https://reviews.llvm.org/D26177 llvm-svn: 286894
* [lsan] [aarch64] Fix printing of pointers in make check tests - updateStrahinja Petrovic2016-11-141-17/+1
| | | | | | | | | This patch replaces fprintf with print_address function in LSAN tests. This is necessary because of different printing of pointers in fprintf and sanitizer's print function. Differential Revision: https://reviews.llvm.org/D26084. llvm-svn: 286816
* tsan: rely on AnnotateRWLockCreateStatic to detect linker-initialized mutexesDmitry Vyukov2016-06-031-0/+25
| | | | | | | | | The new annotation was added a while ago, but was not actually used. Use the annotation to detect linker-initialized mutexes instead of the broken IsGlobalVar which has both false positives and false negatives. Remove IsGlobalVar mess. llvm-svn: 271663
* [TSAN] Fix test java_race_pcSagar Thakur2016-03-021-0/+10
| | | | | | | | | Incremented the pc for each architecture in accordance with StackTrace:GetPreviousInstructionPC Reviewers: samsonov, dvyukov Subscribers: llvm-commits, mohit.bhakkad, jaydeep Differential: http://reviews.llvm.org/D17802 llvm-svn: 262483
* [PPC64, TSAN] LLVM basic enablement of thread sanitizer for PPC64 (BE and LE)Bill Schmidt2015-12-081-1/+1
| | | | | | | | | | | | | | | | | | This patch is by Simone Atzeni with portions by Adhemerval Zanella. This contains the LLVM patches to enable the thread sanitizer for PPC64, both big- and little-endian. Two different virtual memory sizes are supported: Old kernels use a 44-bit address space, while newer kernels require a 46-bit address space. There are two companion patches that will be added shortly. There is a Clang patch to actually turn on the use of the thread sanitizer for PPC64. There is also a patch that I wrote to provide interceptor support for setjmp/longjmp on PPC64. Patch discussion at reviews.llvm.org/D12841. llvm-svn: 255057
* tsan: fix test invisible barrierDmitry Vyukov2015-12-081-17/+14
| | | | | | | | | | | | | | | | | Another attempt at fixing tsan_invisible_barrier. Current implementation causes: https://llvm.org/bugs/show_bug.cgi?id=25643 There were several unsuccessful iterations for this functionality: Initially it was implemented in user code using REAL(pthread_barrier_wait). But pthread_barrier_wait is not supported on MacOS. Futexes are linux-specific for this matter. Then we switched to atomics+usleep(10). But usleep produced parasitic "as-if synchronized via sleep" messages in reports which failed some output tests. Then we switched to atomics+sched_yield. But this produced tons of tsan- visible events, which lead to "failed to restore stack trace" failures. Move implementation into runtime and use internal_sched_yield in the wait loop. This way tsan should see no events from the barrier, so not trace overflows and no "as-if synchronized via sleep" messages. llvm-svn: 255030
* [compiler-rt] Remove SANITIZER_AARCH64_VMA usageAdhemerval Zanella2015-11-301-22/+14
| | | | | | | | | | | | This patch complete removed SANITIZER_AARCH64_VMA definition and usage. AArch64 ports now supports runtime VMA detection and instrumentation for 39 and 42-bit VMA. It also Rewrite print_address to take a variadic argument list (the addresses to print) and adjust the tests which uses it to the new signature. llvm-svn: 254319
* [compiler-rt] [tsan] Unify aarch64 mappingAdhemerval Zanella2015-11-261-1/+1
| | | | | | | | | | | | | This patch unify the 39 and 42-bit support for AArch64 by using an external memory read to check the runtime detected VMA and select the better mapping and transformation. Although slower, this leads to same instrumented binary to be independent of the kernel. Along with this change this patch also fix some 42-bit failures with ALSR disable by increasing the upper high app memory threshold and also the 42-bit madvise value for non large page set. llvm-svn: 254151
* [tsan] Make tests that use CLOCK_MONOTONIC portableKuba Brecka2015-11-201-0/+18
| | | | | | | | Several tests rely on CLOCK_MONOTONIC, which doesn't exist on OS X. This patch fixes these tests by either disabling them (in case of cond_version.c which doesn't make sense on OS X), or by porting the test to also work on OS X. Differential Revision: http://reviews.llvm.org/D14861 llvm-svn: 253658
* tsan: fix flakiness of sleep_sync2 testDmitry Vyukov2015-11-121-1/+4
| | | | llvm-svn: 252869
* tsan: make invisible test barrier portableDmitry Vyukov2015-11-061-20/+17
| | | | | | | | | | | The current implementation does not work on darwin and can have issues with other OSes in future. See http://reviews.llvm.org/D14427 Make it portable once and for all (minus usleep call). Reviewed in: http://reviews.llvm.org/D14434 llvm-svn: 252292
* [compiler-rt] [tsan] Enable TSan for AArch64/42-bit VMAAdhemerval Zanella2015-08-281-1/+17
| | | | | | | | | | | This patch adds support for tsan on aarch64-linux with 42-bit VMA (current default config for 64K pagesize kernels). The support is enabled by defining the SANITIZER_AARCH64_VMA to 42 at build time for both clang/llvm and compiler-rt. The default VMA is 39 bits. It also enabled tsan for previous supported VMA (39). llvm-svn: 246330
* [tsan] Enable tsan for aarch64Adhemerval Zanella2015-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enabled TSAN for aarch64 with 39-bit VMA layout. As defined by tsan_platform.h the layout used is: 0000 4000 00 - 0200 0000 00: main binary 2000 0000 00 - 4000 0000 00: shadow memory 4000 0000 00 - 5000 0000 00: metainfo 5000 0000 00 - 6000 0000 00: - 6000 0000 00 - 6200 0000 00: traces 6200 0000 00 - 7d00 0000 00: - 7d00 0000 00 - 7e00 0000 00: heap 7e00 0000 00 - 7fff ffff ff: modules and main thread stack Which gives it about 8GB for main binary, 4GB for heap and 8GB for modules and main thread stack. Most of tests are passing, with the exception of: * ignore_lib0, ignore_lib1, ignore_lib3 due a kernel limitation for no support to make mmap page non-executable. * longjmp tests due missing specialized assembly routines. These tests are xfail for now. The only tsan issue still showing is: rtl/TsanRtlTest/Posix.ThreadLocalAccesses Which still required further investigation. The test is disable for aarch64 for now. llvm-svn: 244055
* [Tsan] Fix test.h to work on FreeBSDViktor Kutuzov2015-03-131-2/+8
| | | | | | Differential Revision: http://reviews.llvm.org/D8303 llvm-svn: 232167
* [TSan][MIPS64] Fix few more test cases for MIPS64Mohit K. Bhakkad2015-02-201-0/+9
| | | | | | | | | | | | 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: remove sleeps from testsDmitry Vyukov2015-01-211-0/+31
Even sleep(1) lead to episodical flakes on some machines. Use an invisible by tsan barrier to enforce required execution order instead. This makes the tests deterministic and faster. llvm-svn: 226659
OpenPOWER on IntegriCloud