summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan
Commit message (Collapse)AuthorAgeFilesLines
* [TSan] Ensure we can compile the runtime with older SDKsJulian Lettner2020-02-051-1/+8
| | | | | | | | | | | | | | | | | | | | | One of my changes [1] included in this release silently bumped the minimal macOS SDK required for building the TSan runtime to SDK 10.12. Let's ensure release 10 does not unexpectedly break builders with old SDKs and add proper minimal SDK checking in CMake for subsequent releases. This fix `#ifdef`s out interceptors for newer APIs. Note that the resulting TSan runtime is less complete: when these newer APIs are used TSan will report false positives. Fixes llvm 10 release blocker: #44682 https://bugs.llvm.org/show_bug.cgi?id=44682 [1] 894abb46f891cba2e0ef581650f27f512a7824b4 Reviewed By: dmajor Differential Revision: https://reviews.llvm.org/D74059
* [TSan][Darwin] Avoid calling pthread_self() before libpthread is initializedJulian Lettner2019-12-161-1/+6
| | | | | | | | | | | | | | This skips calling `pthread_self` when `main_thread_identity` hasn't been initialized yet. `main_thread_identity` is only ever assigned in `__tsan::InitializePlatform`. This change should be relatively safe; we are not changing behavior other than skipping the call to `pthread_self` when `main_thread_identity == 0`. rdar://57822138 Reviewed By: kubamracek Differential Revision: https://reviews.llvm.org/D71559
* [sanitizer_common] Create max_allocation_size_mb flag.Matt Morehouse2019-10-301-3/+12
| | | | | | | | | | | | | | | | | Summary: The flag allows the user to specify a maximum allocation size that the sanitizers will honor. Any larger allocations will return nullptr or crash depending on allocator_may_return_null. Reviewers: kcc, eugenis Reviewed By: kcc, eugenis Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D69576
* tsan: fix Go ppc64le buildDmitry Vyukov2019-10-151-0/+2
| | | | | | | | This #define is in the non-Go ppc64le build but not in the Go build. Reviewed-in: https://reviews.llvm.org/D68046 Author: randall77 (Keith Randall) llvm-svn: 374868
* [tsan, go] fix Go windows buildVitaly Buka2019-10-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Don't use weak exports when building tsan into a shared library for Go. gcc can't handle the pragmas used to make the weak references. Include files that have been added since the last update to build.bat. (We should really find a better way to list all the files needed.) Add windows version defines (WINVER and _WIN32_WINNT) to get AcquireSRWLockExclusive and ReleaseSRWLockExclusive defined. Define GetProcessMemoryInfo to use the kernel32 version. This is kind of a hack, the windows header files should do this translation for us. I think we're not in the right family partition (we're using Desktop, but that translation only happens for App and System partitions???), but hacking the family partition seems equally gross and I have no idea what the consequences of that might be. Patch by Keith Randall. Reviewers: dvyukov, vitalybuka Reviewed By: vitalybuka Subscribers: jfb, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D68599 llvm-svn: 373984
* [tsan, go] break commands into multiple linesVitaly Buka2019-10-071-3/+55
| | | | | | | | | | | | | | Summary: Patch by Keith Randall. Reviewers: dvyukov, vitalybuka Subscribers: delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D68596 llvm-svn: 373983
* [tsan] Don't delay SIGTRAP handlerVitaly Buka2019-10-071-4/+5
| | | | | | | | | | | | Reviewers: eugenis, jfb Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68604 llvm-svn: 373978
* [compiler-rt] Use GetNextInstructionPc in signal handlersVitaly Buka2019-10-021-1/+1
| | | | | | | | | | | | | | | | | | Summary: All other stack trace callers assume that PC contains return address. HWAsan already use GetNextInstructionPc in similar code. PR43339 Reviewers: eugenis, kcc, jfb Subscribers: dexonsmith, dberris, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68313 llvm-svn: 373529
* Rename tsan_interceptors.cpp into tsan_interceptors_posix.cppVitaly Buka2019-10-013-3/+3
| | | | | | | | | | | | | | | | | | | | | Summary: It's needed to use __GLIBC_PREREQ from <features.h> tsan didn't let us to include <features.h> by using --sysroot=. to disable system includes on anything that is not named as "tsan*posix*", "tsan*mac*", "tsan*linux*". See compiler-rt/lib/tsan/CMakeLists.txt Reviewers: eugenis, dvyukov, kcc Reviewed By: kcc Subscribers: mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68176 llvm-svn: 373282
* [TSAN] Add read/write range interface functions with PCJoachim Protze2019-09-242-0/+13
| | | | | | | | | | Adding annotation function variants __tsan_write_range_pc and __tsan_read_range_pc to annotate ranged access to memory while providing a program counter for the access. Differential Revision: https://reviews.llvm.org/D66885 llvm-svn: 372730
* tsan: allow the Go runtime to return multiple stack frames for a single PCDmitry Vyukov2019-09-181-7/+18
| | | | | | | | | | | This fix allows tsan to report stack traces correctly even in the presence of mid-stack inlining by the Go compiler. See https://go-review.googlesource.com/c/go/+/195781 for the Go runtime side of this change. Author: randall77 (Keith Randall) Reviewed: https://reviews.llvm.org/D67671 llvm-svn: 372205
* Remove NOLINTs from compiler-rtVitaly Buka2019-09-1120-41/+43
| | | | llvm-svn: 371687
* Update compiler-rt cpplint.pyVitaly Buka2019-09-112-11/+10
| | | | | | https://github.com/cpplint/cpplint/commit/adb3500107f409ac5491188ae652ac3f4d03d9d3 llvm-svn: 371675
* [TSan] Add interceptors for mach_vm_[de]allocateJulian Lettner2019-09-095-10/+77
| | | | | | | | | | | | I verified that the test is red without the interceptors. rdar://40334350 Reviewed By: kubamracek, vitalybuka Differential Revision: https://reviews.llvm.org/D66616 llvm-svn: 371439
* [TSan] #include header instead of forward declaring intercepteesJulian Lettner2019-08-211-18/+5
| | | | llvm-svn: 369601
* [TSan] Rename file with libdispatch interceptorsJulian Lettner2019-08-202-2/+2
| | | | llvm-svn: 369314
* [TSan] Rename file to make it clear that it defines interceptorsJulian Lettner2019-08-192-2/+2
| | | | | | | Rename file `tsan_libdispatch.cpp -> tsan_libdispatch_interceptors.cpp` to make it clear that it's main purpose is defining interceptors. llvm-svn: 369289
* Revert "[TSan] Don't guard #include <xpc/xpc.h>"Julian Lettner2019-08-161-0/+7
| | | | | | This reverts commit 8191585b36eb4963002cce43fb2e79e7fb05c3d6. llvm-svn: 369165
* [TSan] Add interceptors for os_unfair_lockJulian Lettner2019-08-161-0/+53
| | | | llvm-svn: 369164
* [TSan] Don't guard #include <xpc/xpc.h>Julian Lettner2019-08-161-7/+0
| | | | | | | | The xpc_connection_* APIs that we are intercepting are available starting at macOS 10.7. This is old enough so that we don't need to guard them. llvm-svn: 369150
* [TSAN] Fix tsan on FreeBSD after D54889Alexander Richardson2019-08-061-0/+1
| | | | | | | | | | | | | | | | | | Summary: It appears that since https://reviews.llvm.org/D54889, BackgroundThread() crashes immediately because cur_thread()-> will return a null pointer which is then dereferenced. I'm not sure why I only see this issue on FreeBSD and not Linux since it should also be unintialized on other platforms. Reviewers: yuri, dvyukov, dim, emaste Subscribers: kubamracek, krytarowski, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D65705 llvm-svn: 368103
* [Sanitizer] Linux explicitally migrate shadow mapping to Transparent Huge PageDavid Carlier2019-08-061-7/+1
| | | | | | | | | | | | in madvise mode, the shadow pages will be migrated only via madvise explicit calls. Reviewers: vitalybuka Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D65775 llvm-svn: 368090
* [Sanitizer] Linux refactor shadow huge page mode handlingDavid Carlier2019-08-051-8/+7
| | | | | | | | | | | | Disabling Transparent huge page mode refactored in one function. Reviewers: vitalybuka Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D65771 llvm-svn: 367925
* Follow-up for r367863 and r367656Nico Weber2019-08-052-2/+2
| | | | llvm-svn: 367888
* Remove a few straggler ".cc"s in compiler-rt/libNico Weber2019-08-011-1/+1
| | | | llvm-svn: 367589
* compiler-rt: Rename .cc file in lib/tsan/{benchmarks,dd,go} to .cppNico Weber2019-08-0112-13/+13
| | | | | | | | | Like r367463, but for tsan/{benchmarks,dd,go}. The files benchmarks aren't referenced in the build anywhere and where added in 2012 with the comment "no Makefiles yet". llvm-svn: 367567
* compiler-rt: Rename .cc file in lib/tsan/tests/{rtl,unit} to .cppNico Weber2019-08-0121-36/+41
| | | | | | Like r367463, but for tsan/tests/{rtl,unit}. llvm-svn: 367566
* compiler-rt: Rename .cc file in lib/tsan/rtl to .cppNico Weber2019-08-0138-94/+100
| | | | | | Like r367463, but for tsan/rtl. llvm-svn: 367564
* Attempt to heal tsan bot after r367463Nico Weber2019-07-311-1/+1
| | | | llvm-svn: 367469
* compiler-rt: Rename .cc file in lib/sanitizer_common to .cppNico Weber2019-07-312-48/+48
| | | | | | | | | | | See https://reviews.llvm.org/D58620 for discussion, and for the commands I ran. In addition I also ran for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done and manually updated (many) references to renamed files found by that. llvm-svn: 367463
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.6Julian Lettner2019-07-161-45/+44
| | | | | | | Cleanup ARM64 assembly after removing unnecessary computation of mangled stack pointer in previous commit. llvm-svn: 366258
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.10Julian Lettner2019-07-162-64/+0
| | | | | | | Remove now-unused assembly code for determining xor key on Linux/AArch64. This is the final commit of this refactoring. llvm-svn: 366225
* [TSan] Fix asm token error (again)Julian Lettner2019-07-151-1/+1
| | | | llvm-svn: 366150
* [TSan] Fix asm token errorJulian Lettner2019-07-151-1/+1
| | | | llvm-svn: 366131
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.9Julian Lettner2019-07-151-22/+5
| | | | | | | Switch over to computing the xor key in C, instead of assembly for Linux/AArch64. llvm-svn: 366126
* [TSan] Tiny cleanup of UnmangleLongJmpSp for Linux/x86_64Julian Lettner2019-07-131-8/+8
| | | | | | NFC. llvm-svn: 365982
* [TSan] Move DECLARE_REAL macro outside of namespaceJulian Lettner2019-07-111-5/+15
| | | | | | | This should fix the "undefined reference to tsan::interception::real_setjmp" linker errors. llvm-svn: 365806
* Add NetBSD LSan supportKamil Rytarowski2019-07-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Combine few relatively small changes into one: - implement internal_ptrace() and internal_clone() for NetBSD - add support for stoptheworld based on the ptrace(2) API - define COMPILER_RT_HAS_LSAN for NetBSD - enable tests for NetBSD/amd64 Inspired by the original implementation by Christos Zoulas in netbsd/src for GCC. The implementation is in theory CPU independent through well defined macros across all NetBSD ports, however only the x86_64 version was tested. Reviewers: mgorny, dvyukov, vitalybuka, joerg, jfb Reviewed By: vitalybuka Subscribers: dexonsmith, jfb, srhines, kubamracek, llvm-commits, christos Tags: #llvm Differential Revision: https://reviews.llvm.org/D64057 llvm-svn: 365735
* [TSan] Fix linker error on Linux/AArch64Julian Lettner2019-07-101-4/+4
| | | | llvm-svn: 365707
* [TSan] Fix compiler error on Linux/AArch64Julian Lettner2019-07-101-1/+1
| | | | llvm-svn: 365693
* [TSan] Attempt to fix linker error on Linux/AArch64Julian Lettner2019-07-101-1/+1
| | | | llvm-svn: 365681
* Reland "[TSan] Improve handling of stack pointer mangling in {set,long}jmp, ↵Julian Lettner2019-07-091-9/+51
| | | | | | | | | | | | | | | | | | pt.8" Fix compilation errors related to `SANITIZER_GO` `#ifdef`s. Refine longjmp key management. For Linux, re-implement key retrieval in C (instead of assembly). Removal of `InitializeGuardPtr` and a final round of cleanups will be done in the next commit. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D64092 > llvm-svn: 365513 llvm-svn: 365560
* [TSan] Refine longjmp key management on DarwinJulian Lettner2019-07-091-5/+6
| | | | | | NFC. llvm-svn: 365554
* Revert "[TSan] Improve handling of stack pointer mangling in {set,long}jmp, ↵Julian Lettner2019-07-092-51/+10
| | | | | | | | pt.8" This reverts commit 521f77e6351fd921f5a81027c7c72addca378989. llvm-svn: 365534
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.8Julian Lettner2019-07-092-10/+51
| | | | | | | | | | | | Refine longjmp key management. For Linux, re-implement key retrieval in C (instead of assembly). Removal of `InitializeGuardPtr` and a final round of cleanups will be done in the next commit. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D64092 llvm-svn: 365513
* [TSan] Fix linker error for Linux/AArch64Julian Lettner2019-07-091-1/+3
| | | | llvm-svn: 365415
* Revert "[TSan] Attempt to fix linker error for Linux on AArch64"Julian Lettner2019-07-082-1/+9
| | | | | | This reverts commit be4148062b155f3be52e0f6ebcb228f2dc137dcf. llvm-svn: 365367
* Revert "[TSan] Improve handling of stack pointer mangling in {set,long}jmp, ↵Julian Lettner2019-07-051-4/+32
| | | | | | | | pt.4" This reverts commit 6bb13da7c16f2a677cc285bb6ffeb79dfb0cfe64. llvm-svn: 365244
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.5Julian Lettner2019-07-051-39/+4
| | | | | | | | | | Remove unnecessary computation of mangled SP for ARM64 architecture. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D64022 llvm-svn: 365230
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.4Julian Lettner2019-07-051-32/+4
| | | | | | | | | | | For x86_64, since we don't clobber %rsi (2nd argument) anymore, we don't have to save/restore it. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D63946 llvm-svn: 365229
OpenPOWER on IntegriCloud