summaryrefslogtreecommitdiff
path: root/lib/tsan
Commit message (Collapse)AuthorAgeFilesLines
* 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) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@374868 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@373984 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@373983 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@373978 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@373529 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@373282 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@372730 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@372205 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove NOLINTs from compiler-rtVitaly Buka2019-09-1120-41/+43
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371687 91177308-0d34-0410-b5e6-96231b3b80d8
* Update compiler-rt cpplint.pyVitaly Buka2019-09-112-11/+10
| | | | | | https://github.com/cpplint/cpplint/commit/adb3500107f409ac5491188ae652ac3f4d03d9d3 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371675 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371439 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] #include header instead of forward declaring intercepteesJulian Lettner2019-08-211-18/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@369601 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Rename file with libdispatch interceptorsJulian Lettner2019-08-202-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@369314 91177308-0d34-0410-b5e6-96231b3b80d8
* [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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@369289 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[TSan] Don't guard #include <xpc/xpc.h>"Julian Lettner2019-08-161-0/+7
| | | | | | This reverts commit 8191585b36eb4963002cce43fb2e79e7fb05c3d6. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@369165 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Add interceptors for os_unfair_lockJulian Lettner2019-08-161-0/+53
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@369164 91177308-0d34-0410-b5e6-96231b3b80d8
* [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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@369150 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368103 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368090 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367925 91177308-0d34-0410-b5e6-96231b3b80d8
* Follow-up for r367863 and r367656Nico Weber2019-08-052-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367888 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a few straggler ".cc"s in compiler-rt/libNico Weber2019-08-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367589 91177308-0d34-0410-b5e6-96231b3b80d8
* 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". git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367567 91177308-0d34-0410-b5e6-96231b3b80d8
* 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}. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367566 91177308-0d34-0410-b5e6-96231b3b80d8
* compiler-rt: Rename .cc file in lib/tsan/rtl to .cppNico Weber2019-08-0138-94/+100
| | | | | | | Like r367463, but for tsan/rtl. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367564 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to heal tsan bot after r367463Nico Weber2019-07-311-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367469 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367463 91177308-0d34-0410-b5e6-96231b3b80d8
* [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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366258 91177308-0d34-0410-b5e6-96231b3b80d8
* [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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366225 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Fix asm token error (again)Julian Lettner2019-07-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366150 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Fix asm token errorJulian Lettner2019-07-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366131 91177308-0d34-0410-b5e6-96231b3b80d8
* [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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366126 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Tiny cleanup of UnmangleLongJmpSp for Linux/x86_64Julian Lettner2019-07-131-8/+8
| | | | | | NFC. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365982 91177308-0d34-0410-b5e6-96231b3b80d8
* [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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365806 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365735 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Fix linker error on Linux/AArch64Julian Lettner2019-07-101-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365707 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Fix compiler error on Linux/AArch64Julian Lettner2019-07-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365693 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Attempt to fix linker error on Linux/AArch64Julian Lettner2019-07-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365681 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365560 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Refine longjmp key management on DarwinJulian Lettner2019-07-091-5/+6
| | | | | | NFC. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365554 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[TSan] Improve handling of stack pointer mangling in {set,long}jmp, ↵Julian Lettner2019-07-092-51/+10
| | | | | | | | pt.8" This reverts commit 521f77e6351fd921f5a81027c7c72addca378989. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365534 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365513 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Fix linker error for Linux/AArch64Julian Lettner2019-07-091-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365415 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[TSan] Attempt to fix linker error for Linux on AArch64"Julian Lettner2019-07-082-1/+9
| | | | | | This reverts commit be4148062b155f3be52e0f6ebcb228f2dc137dcf. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365367 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[TSan] Improve handling of stack pointer mangling in {set,long}jmp, ↵Julian Lettner2019-07-051-4/+32
| | | | | | | | pt.4" This reverts commit 6bb13da7c16f2a677cc285bb6ffeb79dfb0cfe64. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365244 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365230 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365229 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.7Julian Lettner2019-07-024-29/+36
| | | | | | | | | | | Factor out `ExtractLongJmpSp` helper function and move platform-specific code to tsan_platform_{linux,mac}.cc. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D64050 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@364947 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.3Julian Lettner2019-07-012-36/+8
| | | | | | | | | | Remove unnecessary computation of mangled SP for x86_64 architecture. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D63944 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@364874 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Fix initialized and declared ‘extern’ warningJulian Lettner2019-07-011-2/+5
| | | | | | | | | | | | Avoid the following warning which fails a bot (via -Werror). ``` /tmp/gotsan.JfrpVPu7pG/gotsan.cc:10456:25: error: ‘_tsan_pointer_chk_guard’ initialized and declared ‘extern’ [-Werror] extern "C" __tsan::uptr _tsan_pointer_chk_guard = 0; ^~~~~~~~~~~~~~~~~~~~~~~ ``` git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@364823 91177308-0d34-0410-b5e6-96231b3b80d8