summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* [lsan] When necessary, define LSan suppression for tls_get_addr.Alex Shlyapnikov2017-04-261-1/+1
| | | | | | | | | | | | | | | Summary: Generalize already defined LSan suppression for the leak on tls_get_addr, some envs do not have the entire call stack symbolized, so we have to be less specific. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32545 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301434 91177308-0d34-0410-b5e6-96231b3b80d8
* [builtins] Implement emulated TLS on Windows.Frederich Munch2017-04-252-67/+236
| | | | | | | | | | | | | | | Summary: LLVM JIT needs to be able to use emulated TLS on all platforms, and this provides a reference one can compile to enable emutls for Linux/Mac/Windows. Reviewers: chh, howard.hinnant Reviewed By: chh Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D30787 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301350 91177308-0d34-0410-b5e6-96231b3b80d8
* [lsan] When necessary, define LSan suppression for pthread_exit.Alex Shlyapnikov2017-04-251-3/+3
| | | | | | | | | | | | | | | Summary: Generalize already defined LSan suppression for the leak on pthread_exit, some envs do not have the entire call stack symbolized, so we have to be less specific. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32497 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301335 91177308-0d34-0410-b5e6-96231b3b80d8
* [Compiler-rt][MIPS] Fix assert introduce with commit rl301171.Nitesh Jain2017-04-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301307 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r301089 "[builtins] Implement emulated TLS on Windows."Hans Wennborg2017-04-242-222/+67
| | | | | | | | | | | | | | | | | | | | | This broke the self-host build on Windows (PR32777). Original commit message: > [builtins] Implement emulated TLS on Windows. > > Summary: > LLVM JIT needs to be able to use emulated TLS on all platforms, and this provides a reference one can compile to enable emutls for Linux/Mac/Windows. > > Reviewers: chh, howard.hinnant > > Reviewed By: chh > > Subscribers: mgorny, llvm-commits > > Differential Revision: https://reviews.llvm.org/D30787 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301274 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Use posix strerror_r interceptor on android.Evgeniy Stepanov2017-04-241-1/+1
| | | | | | This fixes a regression in r297315. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301243 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Remove the extra word "object" from description of external racesKuba Mracek2017-04-241-2/+2
| | | | | | | | Differential Revision: https://reviews.llvm.org/D32383 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301189 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Cache SizeClassForTransferBatch in the 32-bit local cacheKostya Kortchinsky2017-04-241-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: `SizeClassForTransferBatch` is expensive and is called for every `CreateBatch` and `DestroyBatch`. Caching it means `kNumClasses` calls in `InitCache` instead. This should be a performance gain if more than `kNumClasses / 2` batches are created and destroyed during the lifetime of the local cache. I have chosen to fully remove the function and putting the code in `InitCache`, which is a debatable choice. In single threaded benchmarks leveraging primary backed allocations, this turns out to be a sizeable gain in performances (greater than 5%). In multithreaded benchmarks leveraging everything, it is less significant but still an improvement (about 1%). Reviewers: kcc, dvyukov, alekseyshl Reviewed By: dvyukov Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D32365 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301184 91177308-0d34-0410-b5e6-96231b3b80d8
* [builtins] Implement emulated TLS on Windows.Frederich Munch2017-04-222-67/+222
| | | | | | | | | | | | | | | Summary: LLVM JIT needs to be able to use emulated TLS on all platforms, and this provides a reference one can compile to enable emutls for Linux/Mac/Windows. Reviewers: chh, howard.hinnant Reviewed By: chh Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D30787 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301089 91177308-0d34-0410-b5e6-96231b3b80d8
* [lsan] Enable LSan on PowerPC64.Alex Shlyapnikov2017-04-212-2/+3
| | | | | | | | | | | | Summary: Re-landing reverted D31995 with suppressions defined in D32303 and D32377. Reviewers: eugenis Subscribers: nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D32379 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301048 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress DTLS leak happening in some glibc versions.Alex Shlyapnikov2017-04-211-3/+4
| | | | | | | | | | | | Summary: Refer to https://sourceware.org/bugzilla/show_bug.cgi?id=12650 for the context. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32377 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301043 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Optimize strchr for strict_string_checks=falseVitaly Buka2017-04-211-13/+9
| | | | | | | | | | | | | | Summary: strchr interceptor does not need to call strlen if strict_string_checks is not enabled. Unnecessary strlen calls affect python parser performance. Reviewers: eugenis, kcc Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D32264 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301027 91177308-0d34-0410-b5e6-96231b3b80d8
* [scudo] Bypass Quarantine if its size is set to 0Kostya Kortchinsky2017-04-211-26/+36
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: In the current state of things, the deallocation path puts a chunk in the Quarantine whether it's enabled or not (size of 0). When the Quarantine is disabled, this results in the header being loaded (and checked) twice, and stored (and checksummed) once, in `deallocate` and `Recycle`. This change introduces a `quarantineOrDeallocateChunk` function that has a fast path to deallocation if the Quarantine is disabled. Even though this is not the preferred configuration security-wise, this change saves a sizeable amount of processing for that particular situation (which could be adopted by low memory devices). Additionally this simplifies a bit `deallocate` and `reallocate`. Reviewers: dvyukov, kcc, alekseyshl Reviewed By: dvyukov Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32310 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301015 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Refactor __tsan_external_read/__tsan_external_write to avoid code ↵Kuba Mracek2017-04-211-20/+16
| | | | | | | | | | | | duplication Let's introduce a ExternalAccess function that has the shared code only once. Differential Revision: https://reviews.llvm.org/D32360 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301008 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Track external API accesses as 1-byte accesses (instead of 8-byte)Kuba Mracek2017-04-211-2/+2
| | | | | | | | | | It doesn't really make sense to track them as 8-byte accesses. Differential Revision: https://reviews.llvm.org/D32359 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301001 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Ignore memory accesses for libignored modules for "external" racesKuba Mracek2017-04-213-7/+16
| | | | | | | | | | On Darwin, the setting ignore_noninstrumented_modules is used to suppress false positives in code that users don't have control of. The recently added "external" API (which can be used to detect races on objects provided by system libraries, but the race is actually user's fault) ignores this flag and it can report issues in non-instrumented modules. This patch fixes that. Differential Revision: https://reviews.llvm.org/D31553 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301000 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Don't report bugs from interceptors called from libignored modulesKuba Mracek2017-04-213-1/+4
| | | | | | | | | | This patch make sure we don't report deadlocks and other bug types when we're inside an interceptor that was called from a noninstrumented module (when ignore_noninstrumented_modules=1 is set). Adding a testcase that shows that deadlock detection still works on Darwin (to make sure we're not silencing too many reports). Differential Revision: https://reviews.llvm.org/D31449 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300998 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r300889, r300906, r300935, r300939Diana Picus2017-04-211-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | At least one of the ARM bots is still broken: Command Output (stderr): -- /home/buildslave/buildslave/clang-cmake-armv7-a15-full/llvm/projects/compiler-rt/test/asan/TestCases/Posix/strchr.c:31:12: error: expected string not found in input // CHECK: strchr.c:[[@LINE-2]] ^ <stdin>:3:59: note: scanning from here ==16297==ERROR: AddressSanitizer: SEGV on unknown address 0xb5add000 (pc 0xb6dccaa4 bp 0xbe8c19c8 sp 0xbe8c1570 T0) ^ <stdin>:3:59: note: with expression "@LINE-2" equal to "29" ==16297==ERROR: AddressSanitizer: SEGV on unknown address 0xb5add000 (pc 0xb6dccaa4 bp 0xbe8c19c8 sp 0xbe8c1570 T0) ^ <stdin>:5:57: note: possible intended match here #0 0xb6dccaa3 in strlen /build/glibc-f8FFOS/glibc-2.23/string/../sysdeps/arm/armv6t2/strlen.S:82 Try to fix by reverting r300889 and subsequent fixes: Revert "[asan] Fix test by removing "The signal is caused" check." Revert "[asan] Fix test on ppc64le-linux by checking "UNKNOWN memory access"" Revert "[asan] Match BUS and SIGV to fix test on Darwin" Revert "[asan] Optimize strchr for strict_string_checks=false" git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300955 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable LSan on ppc64, some tests are failing.Alex Shlyapnikov2017-04-212-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300933 91177308-0d34-0410-b5e6-96231b3b80d8
* sanitizer: fix crash with textdomain(NULL) interceptorKostya Serebryany2017-04-201-1/+1
| | | | | | | | | | | | | | | | | | Summary: The textdomain function accepts a NULL parameter (and should then return the current message domain). Add a check for this and include ASAN tests. Link: https://github.com/google/sanitizers/issues/787 Reviewers: m.guseva, kcc Reviewed By: kcc Subscribers: kubamracek Differential Revision: https://reviews.llvm.org/D32318 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300924 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable LSan on PowerPC64.Alex Shlyapnikov2017-04-202-2/+3
| | | | | | | | | | | | Summary: Re-landing reverted D31995 with suppressions defined in D32303. Reviewers: eugenis Subscribers: nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D32314 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300903 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Optimize strchr for strict_string_checks=falseVitaly Buka2017-04-201-13/+9
| | | | | | | | | | | | | | Summary: strchr interceptor does not need to call strlen if strict_string_checks is not enabled. Unnecessary strlen calls affect python parser performance. Reviewers: eugenis, kcc Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D32264 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300889 91177308-0d34-0410-b5e6-96231b3b80d8
* Define standard suppressions for LSan, start with this one.Alex Shlyapnikov2017-04-201-6/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300887 91177308-0d34-0410-b5e6-96231b3b80d8
* Define a suppression for known leaks on pthread_exit call.Alex Shlyapnikov2017-04-203-6/+20
| | | | | | | | | | | | Summary: Refer to D32194 for the context. Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D32303 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300886 91177308-0d34-0410-b5e6-96231b3b80d8
* [scudo] Remove GetActuallyAllocatedSize calls from the fast pathKostya Kortchinsky2017-04-202-30/+49
| | | | | | | | | | | | | | | | | | | | | | Summary: GetActuallyAllocatedSize is actually expensive. In order to avoid calling this function in the malloc/free fast path, we change the Scudo chunk header to store the size of the chunk, if from the Primary, or the amount of unused bytes if from the Secondary. This way, we only have to call the culprit function for Secondary backed allocations (and still in realloc). The performance gain on a singly threaded pure malloc/free benchmark exercising the Primary allocator is above 5%. Reviewers: alekseyshl, kcc, dvyukov Reviewed By: dvyukov Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32299 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300861 91177308-0d34-0410-b5e6-96231b3b80d8
* [scudo] Minor changes and refactoringKostya Kortchinsky2017-04-205-162/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is part of D31947 that is being split into several smaller changes. This one deals with all the minor changes, more specifically: - Rename some variables and functions to make their purpose clearer; - Reorder some code; - Mark the hot termination incurring checks as `UNLIKELY`; if they happen, the program will die anyway; - Add a `getScudoChunk` method; - Add an `eraseHeader` method to ScudoChunk that will clear a header with 0s; - Add a parameter to `allocate` to know if the allocated chunk should be filled with zeros. This allows `calloc` to not have to call `GetActuallyAllocatedSize`; more changes to get rid of this function on the hot paths will follow; - reallocate was missing a check to verify that the pointer is properly aligned on `MinAlignment`; - The `Stats` in the secondary have to be protected by a mutex as the `Add` and `Sub` methods are actually not atomic; - The software CRC32 function was moved to the header to allow for inlining. Reviewers: dvyukov, alekseyshl, kcc Reviewed By: dvyukov Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32242 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300846 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay][compiler-rt] Cleanup CFI/CFA annotations on trampolinesDean Michael Berris2017-04-201-19/+14
| | | | | | | | | | | | | | | | | | | | | | Summary: This is a follow-up to D32202. While the previous change (D32202) did fix the stack alignment issue, we were still at a weird state in terms of the CFI/CFA directives (as the offsets were wrong). This change cleans up the SAVE/RESTORE macros for the trampoline, accounting the stack pointer adjustments with less instructions and with some clearer math. We note that the offsets will be different on the exit trampolines, because we don't typically 'call' into this trampoline and we only ever jump into them (i.e. treated as a tail call that's patched in at runtime). Reviewers: eugenis, kpw, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32214 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300815 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer-coverage] remove more unused codeKostya Serebryany2017-04-193-26/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300780 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer-coverage] remove run-time support for ↵Kostya Serebryany2017-04-193-111/+0
| | | | | | -fsanitize-coverage=indirect-calls git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300775 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer-coverage] remove run-time support for -fsanitize-coverage=trace-bbKostya Serebryany2017-04-192-113/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300766 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixup style from r300760Francis Ricci2017-04-191-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300765 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure to scan mmap'd memory regions for root pointers on OS XFrancis Ricci2017-04-193-29/+58
| | | | | | | | | | | | | | | | | | | Summary: In the general case, we only need to check for root regions inside the memory map returned by procmaps. However, on Darwin, we also need to check inside mmap'd regions, which aren't returned in the list of modules we get from procmaps. This patch refactors memory region scanning on darwin to reduce code duplication with the kernel alloc once page scan. Reviewers: kubamracek, alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32190 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300760 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement StopTheWorld for DarwinFrancis Ricci2017-04-192-2/+47
| | | | | | | | | | Reviewers: kubamracek, alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32189 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300759 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn symbolization on for ASan unit test.Alex Shlyapnikov2017-04-191-4/+15
| | | | | | | | | | | | | | | | | | | | | | Summary: On PowerPC and ARM (possibly, need to verify), couple tests involving pthread_exit fail due to leaks detected by LSan. pthread_exit tries to perform unwinding that leads to dlopen'ing libgcc_s.so. dlopen mallocs "libgcc_s.so" string which confuses LSan, it fails to realize that this allocation happens in dynamic linker and should be ignored. Symbolized leak report is required to define a suppression for this known problem. Reviewers: eugenis Subscribers: aemerson, rengolin, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D32194 Turn symbolization on for PPC and Thumb only to do not slow down other platforms. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300748 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer-coverage] remove run-time support for the deprecated ↵Kostya Serebryany2017-04-193-123/+0
| | | | | | -fsanitize-coverage=8bit-counters git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300745 91177308-0d34-0410-b5e6-96231b3b80d8
* Let ubsan search UBSAN_SYMBOLIZER_PATH for llvm-symbolizerNico Weber2017-04-191-0/+1
| | | | | | | https://reviews.llvm.org/D27375 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300692 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement function to get registers from suspended thread on darwinFrancis Ricci2017-04-191-2/+43
| | | | | | | | | | Reviewers: kubamracek, alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32182 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300691 91177308-0d34-0410-b5e6-96231b3b80d8
* Move valid caller-pc checks out of platform-specific checksFrancis Ricci2017-04-194-64/+77
| | | | | | | | | | | | | | | | | | | | | | Summary: ProcessPlatformSpecificAllocations for linux leak sanitizer iterated over memory chunks and ran two checks concurrently: 1) Ensured the pc was valid 2) Checked whether it was a linker allocation All platforms will need the valid pc check, so it is moved out of the platform- specific file. To prevent code and logic duplication, the linker allocation check is moved as well, with the name of the linker supplied by the platform-specific module. In cases where we don't need to check for linker allocations (ie Darwin), this name will be a nullptr, and we'll only run the caller pc checks. Reviewers: kubamracek, alekseyshl, kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32130 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300690 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay][compiler-rt] Fix up CFI annotations and stack alignmentDean Michael Berris2017-04-191-43/+46
| | | | | | | | | | | | | | | | | | | Summary: Previously, we had been very undisciplined about CFI annotations with the XRay trampolines. This leads to runtime crashes due to mis-alined stack pointers that some function implementations may run into (i.e. those using instructions that require properly aligned addresses coming from the stack). This patch attempts to clean that up, as well as more accurately use the correct amounts of space on the stack for stashing and un-stashing registers. Reviewers: eugenis, kcc Subscribers: kpw, llvm-commits Differential Revision: https://reviews.llvm.org/D32202 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300660 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement suspended thread register count for darwinFrancis Ricci2017-04-181-2/+1
| | | | | | | | | | Reviewers: kubamracek, alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32165 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300599 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove mips64 defines from darwin-specific fileFrancis Ricci2017-04-181-2/+2
| | | | | | | | | | Reviewers: kubamracek, alekseyshl Subscribers: llvm-commits, arichardson Differential Revision: https://reviews.llvm.org/D32183 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300598 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Don't include <linux/user.h> in ↵Maxim Ostapenko2017-04-181-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | sanitizer_stoptheworld_linux_libcdep.cc on ARM Android Turned out that adding defined(_arm_) in sanitizer_stoptheworld_linux_libcdep.cc breaks android arm with some toolchains. .../llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:36:11: fatal error: 'linux/user.h' file not found # include <linux/user.h> // for pt_regs ^ 1 error generated. Context: #if SANITIZER_ANDROID && defined(__arm__) # include <linux/user.h> // for pt_regs #else This patch removes corresponding #if SANITIZER_ANDROID && defined(__arm__) and a bit rearranges adjacent сode. Differential Revision: https://reviews.llvm.org/D32128 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300531 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay][compiler-rt] Use emulated TSC when CPU supports rdtscp, but cannot ↵Douglas Yung2017-04-183-6/+23
| | | | | | | | | | | | | | | | | | | | | | determine the CPU frequency A problem arises if a machine supports the rdtscp instruction, but the processor frequency cannot be determined by the function getTSCFrequency(). In this case, we want to use the emulated TSC instead. This patch implements that by adding a call to getTSCFrequency() from probeRequiredCPUFeatures(), and the function only returns true if both the processor supports rdtscp and the CPU frequency can be determined. This should fix PR32620. Reviewers: dberris Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32067 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300525 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Fixup for r300483 (which is a fixup for r300473).Evgeniy Stepanov2017-04-181-4/+5
| | | | | | Sanitizer Printf() does not know about %lu. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300521 91177308-0d34-0410-b5e6-96231b3b80d8
* Update suspended threads info to be compatible with darwinFrancis Ricci2017-04-174-37/+119
| | | | | | | | | | | | | | | Summary: On Darwin, we need to track thread and tid as separate values. This patch splits out the implementation of the suspended threads list to be OS-specific. Reviewers: glider, kubamracek, kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31474 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300491 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixup for r300473: Use %lu on Linux for tid_t in format strings.Kuba Mracek2017-04-171-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300483 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Introduce tid_t as a typedef for OS-provided thread IDsKuba Mracek2017-04-1720-41/+45
| | | | | | | | | | We seem to assume that OS-provided thread IDs are either uptr or int, neither of which is true on Darwin. This introduces a tid_t type, which holds a OS-provided thread ID (gettid on Linux, pthread_threadid_np on Darwin, pthread_self on FreeBSD). Differential Revision: https://reviews.llvm.org/D31774 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300473 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't read non-readable address ranges during lsan pointer scanningFrancis Ricci2017-04-177-11/+22
| | | | | | | | | | | | Summary: This specifically addresses the Mach-O zero page, which we cannot read from. Reviewers: kubamracek, samsonov, alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32044 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300456 91177308-0d34-0410-b5e6-96231b3b80d8
* Scan Kernel Alloc Once page for global pointersFrancis Ricci2017-04-171-1/+27
| | | | | | | | | | | | Summary: libxpc stashes some pointers here. Reviewers: kubamracek, alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32045 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300450 91177308-0d34-0410-b5e6-96231b3b80d8
* [profile] Sync up InstrProfData.inc (NFC)Vedant Kumar2017-04-151-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300383 91177308-0d34-0410-b5e6-96231b3b80d8