summaryrefslogtreecommitdiff
path: root/test/tsan
AgeCommit message (Collapse)Author
2018-07-24[tsan] Fix crash in objc_sync_enter/objc_sync_exit when using an Obj-C ↵Kuba Mracek
tagged pointer Objective-C tagged pointers (either bottom-most or top-most bit is 1) are valid Obj-C objects but are not valid pointers. Make sure we don't crash on them when used in objc_sync_enter/objc_sync_exit. Instead, let's synchronize on a global object. Differential Revision: https://reviews.llvm.org/D49707 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337837 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-13Remove `tsan/Darwin/gcd-after-null.mm` test.Dan Liew
Summary: This test invokes undocumented behaviour that could change in the future. Given this, it's probably best to just remove the test. rdar://problem/42022283 Reviewers: kubamracek Subscribers: llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D49269 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336977 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-10[compiler-rt] Get rid of "%T" expansionsFilipe Cabecinhas
Summary: Original patch by Kuba Mracek The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t. This patch removes %T in compiler-rt. Differential Revision: https://reviews.llvm.org/D48618 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336661 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-20[TSan] fix build and couple of unit tests on FreeBSDDavid Carlier
Similarly to Msan adding -pie provokes linkage issue, was spotted with pie_test.cc Set to XFAIL for couple of unit tests. Reviewers: vitalybuka, krytarowski, dim Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D48317 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335166 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-20[sanitizer] Unify and generalize Apple platforms in CMake and lit test configsKuba Mracek
There's more platforms than just "ios" and "iossim" that we should support, and adding more lit config variables for each platform isn't great. Let's generalize and have a single value that determines what the platform under test is. Differential Revision: https://reviews.llvm.org/D48309 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335123 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-18[TSan] Report proper error on allocator failures instead of CHECK(0)-ingAlex Shlyapnikov
Summary: Following up on and complementing D44404 and other sanitizer allocators. Currently many allocator specific errors (OOM, for example) are reported as a text message and CHECK(0) termination, no stack, no details, not too helpful nor informative. To improve the situation, detailed and structured common errors were defined and reported under the appropriate conditions. Common tests were generalized a bit to cover a slightly different TSan stack reporting format, extended to verify errno value and returned pointer value check is now explicit to facilitate debugging. Reviewers: dvyukov Subscribers: srhines, kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48087 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334975 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-11[sanitizer] Add fgets, fputs and puts into sanitizer_commonPeter Wu
Summary: Add fgets, fputs and puts to sanitizer_common. This adds ASAN coverage for these functions, extends MSAN support from fgets to fputs/puts and extends TSAN support from puts to fputs. Fixes: https://github.com/google/sanitizers/issues/952 Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D46545 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334450 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-24[tsan] Fix a failure in test java_race_pc on AArch64 after r333071Igor Kudrin
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@333180 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14Fix another case where libstdc++ is being inappropriately requested (seeDan Liew
r328775) for all platforms. Given that this is the second occurance of this problem it seemed worth fixing this problem in a more generic way. r328775 has been reverted and now a substitution `%linux_static_libstdcplusplus` has been provided. This substitution expands to Clang driver arguments to use a static libstdc++ on Linux and on all other platforms it expands to nothing. The `asan/TestCases/throw_invoke_test.cc` and `test/tsan/static_init6.cc` test cases now use this substitution. rdar://problem/39948818 Differential Revision: https://reviews.llvm.org/D46401 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332254 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-10[tsan] Add debugging API to retrieve the "external tag" from reportsKuba Mracek
Differential Revision: https://reviews.llvm.org/D46661 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332048 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-03Revert "Follow-up to r331378. Update tests to allow to use C atomics in C++."Volodymyr Sapsai
It reverts commit r331484 because it caused test failures ThreadSanitizer-x86_64 :: Darwin/gcd-groups-destructor.mm ThreadSanitizer-x86_64 :: Darwin/libcxx-shared-ptr-stress.mm ThreadSanitizer-x86_64 :: Darwin/xpc-race.mm Foundation.h transitively includes <atomic>, so we have a case of benign mixing <stdatomic.h> and <atomic>. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@331491 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-03Follow-up to r331378. Update tests to allow to use C atomics in C++.Volodymyr Sapsai
Reviewers: kubamracek Reviewed By: kubamracek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D46363 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@331484 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-27tsan: improve "destroy of a locked mutex" reportsDmitry Vyukov
1. Allow to suppress by current stack. We generally allow to suppress by all main stacks. Current is probably the stack one wants to use to suppress such reports. 2. Fix last lock stack restoration. We trimmed shadow value by storing it in u32. This magically worked for the test that provoked the report on the main thread. But this breaks for locks in any other threads. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@331023 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-13[tsan] Add interceptors for objc_sync_enter and objc_sync_exitKuba Mracek
Objective-C's @synchronize synchronization primitive uses calls to objc_sync_enter and objc_sync_exit runtime functions. In most cases, they end up just calling pthread_mutex_lock/pthread_mutex_unlock, but there are some cases where the synchronization from pthread_mutex_lock/pthread_mutex_unlock interceptors isn't enough. Let's add explicit interceptors for objc_sync_enter and objc_sync_exit to handle all cases. Differential Revision: https://reviews.llvm.org/D45487 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@329982 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21tsan: support inlined frames in external symbolizationDmitry Vyukov
New API passes a callback function to the external symbolizer, allowing it to add multiple frames to the traceback. Note that the old interface API will be still supported until the clients migrate to the new one. Author: asmundak (Alexander Smundak) Reviewed in: https://reviews.llvm.org/D44714 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328079 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-07[Fuzzer] Avoid the unnecessary rebuild of the custom libc++Petr Hosek
This changes the add_custom_libcxx macro to resemble the llvm_ExternalProject_Add. The primary motivation is to avoid unnecessary libFuzzer rebuilds that are being done on every Ninja/Make invocation. The libc++ should be only rebuilt whenever the libc++ source itself changes. Differential Revision: https://reviews.llvm.org/D43213 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326921 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-26Fix which Darwin versions have ObjC runtime with full subscripting support.Volodymyr Sapsai
Update min deployment target in some tests so that they don't try to link against libarclite and don't fail when it's not available. rdar://problem/29253617 Reviewers: vsk, kubamracek Reviewed By: vsk Subscribers: jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D43787 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326143 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-10Correct a typo in tsan_pthread_setname_np in the FreeBSD codeKamil Rytarowski
Noted by David CARLIER. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324811 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-29tsan: deflake a testDmitry Vyukov
There was a failure on a bot: http://lab.llvm.org:8011/builders/clang-cmake-mipsel/builds/1283 strerror test is indeed flaky. We protect all races by a barrier in other tests to eliminate flakiness. Do the same here. No idea why tls_race2.cc failed. Add output at the end of the test as we do in other tests. Sometimes test process crashes somewhere in the middle (e.g. during race reporting) and it looks like empty output. Output at the end of test allows to understand if the process has crashed, or it has finished but produced no race reports. Reviewed in https://reviews.llvm.org/D42633 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323657 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-20Force lit to execute the ASan and TSan tests on iOS devicesDan Liew
sequentially. The current implementation of commands in `test/sanitizer_common/ios_commands/` for iOS devices cannot be executed in parallel which results in the ASan and TSan tests failing when executed in parallel by lit which was the default behaviour. We now force the ASan and TSan tests to be a new parallelism group named `darwin-ios-device-sanitizer` which allows only one test to be run at a time. We also emit a warning informing the user that tests are being run sequentially. This only applies if the target is an iOS device. Differential Revision: https://reviews.llvm.org/D42156 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323026 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12[CMake] Support runtimes and monorepo layouts when looking for libcxxPetr Hosek
This also slightly refactors the code that's checking the directory presence which allows eliminating one unnecessary variable. Differential Revision: https://reviews.llvm.org/D40637 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320446 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01[ubsan] Re-commit: lit changes for lld testing, future lto testing.Roman Lebedev
Summary: As discussed in https://github.com/google/oss-fuzz/issues/933, it would be really awesome to be able to use ThinLTO for fuzzing. However, as @kcc has pointed out, it is currently undefined (untested) whether the sanitizers actually function properly with LLD and/or LTO. This patch is inspired by the cfi test, which already do test with LTO (and/or LLD), since LTO is required for CFI to function. I started with UBSan, because it's cmakelists / lit.* files appeared to be the cleanest. This patch adds the infrastructure to easily add LLD and/or LTO sub-variants of the existing lit test configurations. Also, this patch adds the LLD flavor, that explicitly does use LLD to link. The check-ubsan does pass on my machine. And to minimize the [initial] potential buildbot breakage i have put some restrictions on this flavour. Please review carefully, i have not worked with lit/sanitizer tests before. The original attempt, r319525 was reverted in r319526 due to the failures in compiler-rt standalone builds. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: #sanitizers, pcc, kubamracek, mgorny, llvm-commits, mehdi_amini, inglorion, kcc Differential Revision: https://reviews.llvm.org/D39508 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319575 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01Revert "[ubsan] lit changes for lld testing, future lto testing."Roman Lebedev
This reverts commit r319525. This change has introduced a problem with the Lit tests build for compiler-rt using Gold: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/6047/steps/test%20standalone%20compiler-rt/logs/stdio llvm-lit: /b/sanitizer-x86_64-linux/build/llvm/utils/lit/lit/TestingConfig.py:101: fatal: unable to parse config file '/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg', traceback: Traceback (most recent call last): File "/b/sanitizer-x86_64-linux/build/llvm/utils/lit/lit/TestingConfig.py", line 88, in load_from_path exec(compile(data, path, 'exec'), cfg_globals, None) File "/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg", line 37, in <module> if root.host_os not in ['Linux'] or not is_gold_linker_available(): File "/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg", line 27, in is_gold_linker_available stderr = subprocess.PIPE) File "/usr/lib/python2.7/subprocess.py", line 390, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319529 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01[ubsan] lit changes for lld testing, future lto testing.Roman Lebedev
Summary: As discussed in https://github.com/google/oss-fuzz/issues/933, it would be really awesome to be able to use ThinLTO for fuzzing. However, as @kcc has pointed out, it is currently undefined (untested) whether the sanitizers actually function properly with LLD and/or LTO. This patch is inspired by the cfi test, which already do test with LTO (and/or LLD), since LTO is required for CFI to function. I started with UBSan, because it's cmakelists / lit.* files appeared to be the cleanest. This patch adds the infrastructure to easily add LLD and/or LTO sub-variants of the existing lit test configurations. Also, this patch adds the LLD flavor, that explicitly does use LLD to link. The check-ubsan does pass on my machine. And to minimize the [initial] potential buildbot breakage i have put some restrictions on this flavour. Please review carefully, i have not worked with lit/sanitizer tests before. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: #sanitizers, pcc, kubamracek, mgorny, llvm-commits, mehdi_amini, inglorion, kcc Differential Revision: https://reviews.llvm.org/D39508 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319525 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-27[TSan] Do not run cond_cancel.c test on ppc64.Matt Morehouse
After r319004, the expected failure on ppc64 manifests as an infinite loop. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319114 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16Implement GetTls() for NetBSDKamil Rytarowski
Summary: Reuse the existing code for FreeBSD that is compatible with NetBSD. Add NetBSD support in tests: tls_race.cc and tls_race2.cc. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dvyukov, vitalybuka, kcc, eugenis Reviewed By: dvyukov Subscribers: srhines, emaste, kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40105 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318431 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08Correct atexit(3) support in TSan/NetBSDKamil Rytarowski
Summary: The NetBSD specific implementation of cxa_atexit() does not preserve the 2nd argument if dso is equal to NULL. Changes: - Split paths of handling intercepted __cxa_atexit() and atexit(3). This affects all supported Operating Systems. - Add a local stack-like structure to hold the __cxa_atexit() context. atexit(3) is documented in the C standard as calling callback from the earliest to the oldest entry. This path also fixes potential ABI problem of passing an argument to a function from the atexit(3) callback mechanism. - Add new test to ensure LIFO style of atexit(3) callbacks: atexit3.cc Proposal to change the behavior of __cxa_atexit() in NetBSD has been rejected. With the above changes TSan/NetBSD with the current tsan_interceptors.cc can bootstrap into operation. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, dvyukov, joerg, kcc, eugenis Reviewed By: dvyukov Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D39619 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317735 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-25Add NetBSD improvements in sanitizersKamil Rytarowski
Summary: Changes: * Add initial msan stub support. * Handle NetBSD specific pthread_setname_np(3). * NetBSD supports __attribute__((tls_model("initial-exec"))), define it in SANITIZER_TLS_INITIAL_EXEC_ATTRIBUTE. * Add ReExec() specific bits for NetBSD. * Simplify code and add syscall64 and syscall_ptr for !NetBSD. * Correct bunch of syscall wrappers for NetBSD. * Disable test/tsan/map32bit on NetBSD as not applicable. * Port test/tsan/strerror_r to a POSIX-compliant OSes. * Disable __libc_stack_end on NetBSD. * Disable ReadNullSepFileToArray() on NetBSD. * Define struct_ElfW_Phdr_sz, detected missing symbol by msan. * Change type of __sanitizer_FILE from void to char. This helps to reuse this type as an array. Long term it will be properly implemented along with SANITIZER_HAS_STRUCT_FILE setting to 1. * Add initial NetBSD support in lib/tsan/go/buildgo.sh. * Correct referencing stdout and stderr in tsan_interceptors.cc on NetBSD. * Document NetBSD x86_64 specific virtual memory layout in tsan_platform.h. * Port tests/rtl/tsan_test_util_posix.cc to NetBSD. * Enable NetBSD tests in test/msan/lit.cfg. * Enable NetBSD tests in test/tsan/lit.cfg. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis, kcc, dvyukov Reviewed By: dvyukov Subscribers: #sanitizers, llvm-commits, kubamracek Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D39124 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316591 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-20tsan: add tests missed in r316209Dmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316210 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-20[tsan] Add Mutex annotation flag for constant-initialized ↵Dmitry Vyukov
__tsan_mutex_linker_init behavior Add a new flag, _⁠_tsan_mutex_not_static, which has the opposite sense of _⁠_tsan_mutex_linker_init. When the new _⁠_tsan_mutex_not_static flag is passed to _⁠_tsan_mutex_destroy, tsan ignores the destruction unless the mutex was also created with the _⁠_tsan_mutex_not_static flag. This is useful for constructors that otherwise woud set _⁠_tsan_mutex_linker_init but cannot, because they are declared constexpr. Google has a custom mutex with two constructors, a "linker initialized" constructor that relies on zero-initialization and sets ⁠_⁠_tsan_mutex_linker_init, and a normal one which sets no tsan flags. The "linker initialized" constructor is morally constexpr, but we can't declare it constexpr because of the need to call into tsan as a side effect. With this new flag, the normal c'tor can set _⁠_tsan_mutex_not_static, the "linker initialized" constructor can rely on tsan's lazy initialization, and _⁠_tsan_mutex_destroy can still handle both cases correctly. Author: Greg Falcon (gfalcon) Reviewed in: https://reviews.llvm.org/D39095 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316209 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-11Disable TSan tests on Android.Evgeniy Stepanov
They never passed. This change excludes them from 'check-all'. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315512 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10Factor out "stable-runtime" feature and enable it on all android.Evgeniy Stepanov
This is a very poorly named feature. I think originally it meant to cover linux only, but the use of it in msan seems to be about any aarch64 platform. Anyway, this change should be NFC on everything except Android. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315389 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-28tsan: handle signals in pause callDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314384 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22Deflake the "xpc-race.mm" test.Kuba Mracek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314014 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12[tsan] Disable user_malloc test which fails glibc 2.24Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-30Add NetBSD support in test/tsan/thread_name*.ccKamil Rytarowski
Summary: A snipped from the documentation of thread_setname_np(3): NAME pthread_getname_np - get and set descriptive name of a thread LIBRARY POSIX Threads Library (libpthread, -lpthread) SYNOPSIS #include <pthread.h> int pthread_getname_np(pthread_t thread, char *name, size_t len); int pthread_setname_np(pthread_t thread, const char *name, void *arg); Sponsored by <The NetBSD Foundation> Reviewers: joerg, dvyukov, eugenis, vitalybuka, kcc Reviewed By: dvyukov Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D37306 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312159 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-25tsan: fix darwin buildDmitry Vyukov
Runtime hooks do not seem to work on darwin. The test failed on builder: http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/34882/consoleFull#7286766538254eaf0-7326-4999-85b0-388101f2d404 Move the test to Linux dir. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311776 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-25tsan: don't pass bogus PCs to __tsan_symbolize_externalDmitry Vyukov
See the added comment for an explanation. Reviewed in https://reviews.llvm.org/D37107 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311768 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-24[Sanitizers] TSan allocator set errno on failure.Alex Shlyapnikov
Summary: Set proper errno code on allocation failures and change realloc, pvalloc, aligned_alloc, memalign and posix_memalign implementation to satisfy their man-specified requirements. Modify allocator API implementation to bring it closer to other sanitizers allocators. Reviewers: dvyukov Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D35690 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308929 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16[tsan] Disable test with debug runtimeVitaly Buka
Test expects at least -O1 compiled runtime. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308121 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12Add explicit CMake targets for ASan/TSan iOS Simulator testing and update ↵Kuba Mracek
the instructions how to run them. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12tsan: add test for __tsan_java_findDmitry Vyukov
The test should have been added in 289682 "tsan: allow Java VM iterate over allocated objects" but I forgot to avn add. Author: Alexander Smundak (asmundak) Reviewed in https://reviews.llvm.org/D27720 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307776 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10Fix-up for r307537: We need to #include stdint.h to get int32_t.Kuba Mracek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307557 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10Fixup whitespace.Kuba Mracek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307538 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10[tsan] Add support for running TSan tests on iOS simulator and devicesKuba Mracek
Differential Revision: https://reviews.llvm.org/D35157 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307537 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05[tsan] Use pthread_sigmask instead of sigprocmask to block signals in a ↵Kuba Mracek
thread on Darwin On Darwin, sigprocmask changes the signal mask for the entire process. This has some unwanted consequences, because e.g. internal_start_thread wants to disable signals only in the current thread (to make the new thread inherit the signal mask), which is currently broken on Darwin. This patch switches to pthread_sigmask. Differential Revision: https://reviews.llvm.org/D35016 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307212 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-03fix trivial typos in comments; NFCHiroshi Inoue
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307005 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28[Sanitizers] Operator new() interceptors always die on allocation errorAlex Shlyapnikov
Summary: Operator new interceptors behavior is now controlled by their nothrow property as well as by allocator_may_return_null flag value: - allocator_may_return_null=* + new() - die on allocation error - allocator_may_return_null=0 + new(nothrow) - die on allocation error - allocator_may_return_null=1 + new(nothrow) - return null Ideally new() should throw std::bad_alloc exception, but that is not trivial to achieve, hence TODO. Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D34731 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306604 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13tsan: fix reading of mutex flagsDmitry Vyukov
SyncVar::IsFlagSet returns true if any flag is set. This is wrong. Check the actual requested flag. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305281 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07Mark the tsan strerror_r test as unsupported on DarwinVedant Kumar
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304944 91177308-0d34-0410-b5e6-96231b3b80d8