summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/tests
Commit message (Collapse)AuthorAgeFilesLines
* [sanitizer] Link Sanitizer-x86_64-Test-Nolibc with -staticFangrui Song2019-12-271-1/+1
| | | | | | | | | | | Pass -static so that clang will not pass -Wl,--dynamic-linker,... to the linker. The test is not expected to run under a ld.so. (Technically it works under a ld.so but glibc expects to see a PT_DYNAMIC. lld intentionally does not follow GNU ld's complex rules regarding PT_DYNAMIC.) This allows commit 1417558e4a61794347c6bfbafaff7cd96985b2c3 to be relanded.
* [sanitizer] Construct InternalMmapVector without memory allocation.Igor Kudrin2019-12-171-1/+1
| | | | | | | | | Construction of InternalMmapVector is often followed by a call to reserve(), which may result in immediate reallocation of the memory for the internal storage. This patch delays that allocation until it is really needed. Differential Revision: https://reviews.llvm.org/D71342
* [SanitizerCommon] Reduce wasting memory in LowLevelAllocator.Igor Kudrin2019-12-111-0/+11
| | | | | | | | | MmapOrDie allocates memory multiple to page size. LowLevelAllocator should use all that memory for the internal buffer because there are chances that subsequent requests may be small enough to fit in that space. Differential Revision: https://reviews.llvm.org/D71275
* Fix warning: format specifies type 'unsigned long' but the argument has type ↵Alexandre Ganea2019-11-041-0/+4
| | | | 'unsigned long long' [-Wformat]
* [compiler-rt] Remove some cpplint filtersVitaly Buka2019-09-122-6/+6
| | | | llvm-svn: 371704
* Remove NOLINTs from compiler-rtVitaly Buka2019-09-114-43/+36
| | | | llvm-svn: 371687
* Revert r369472 and r369441Vitaly Buka2019-08-211-40/+0
| | | | | | check-sanitizer does not work on Linux llvm-svn: 369495
* [AArch64] Speed-up leak and address sanitizers on AArch64 for 48-bit VMASebastian Pop2019-08-201-0/+40
| | | | | | | | | | | | | | | | | | This patch fixes https://github.com/google/sanitizers/issues/703 On a Graviton-A1 aarch64 machine with 48-bit VMA, the time spent in LSan and ASan reduced from 2.5s to 0.01s when running clang -fsanitize=leak compiler-rt/test/lsan/TestCases/sanity_check_pure_c.c && time ./a.out clang -fsanitize=address compiler-rt/test/lsan/TestCases/sanity_check_pure_c.c && time ./a.out With this patch, LSan and ASan create both the 32 and 64 allocators and select at run time between the two allocators following a global variable that is initialized at init time to whether the allocator64 can be used in the virtual address space. Differential Revision: https://reviews.llvm.org/D60243 llvm-svn: 369441
* [sanitizer_common][tests] Fix SanitizerCommon-Unit :: ↵Rainer Orth2019-08-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ./Sanitizer-*-Test/SanitizerCommon.PthreadDestructorIterations on Solaris SanitizerCommon.PthreadDestructorIterations currently FAILs on Solaris: [ RUN ] SanitizerCommon.PthreadDestructorIterations /vol/llvm/src/compiler-rt/local/lib/sanitizer_common/tests/sanitizer_posix_test.cc:58: Failure Value of: destructor_executed Actual: true Expected: false [ FAILED ] SanitizerCommon.PthreadDestructorIterations (1 ms) It turns out that destructor is called 4 times after the first call to SpawnThread, but 5 times after the second. While PTHREAD_DESTRUCTOR_ITERATIONS is 4 in <limits.h>, the Solaris pthread_key_create(3C) man page documents If, after all the destructors have been called for all keys with non- null values, there are still some keys with non-null values, the process will be repeated. POSIX requires that this process be executed at least PTHREAD_DESTRUCTOR_ITERATIONS times. Solaris calls the destructors repeatedly until all values with associated destructors are NULL. Destructors that set new values can cause an infinite loop. The patch adjusts the test case to allow for this. Tested on x86_64-pc-solaris2.11. Differential Revision: https://reviews.llvm.org/D65055 llvm-svn: 367705
* compiler-rt: Try to appease lint script.Nico Weber2019-07-312-9/+7
| | | | | | | | | | | | | A bot complains: /b/sanitizer-x86_64-linux-autoconf/build/llvm/projects/compiler-rt/lib/sanitizer_common/tests/malloc_stress_transfer_test.cpp:2: Streams are highly discouraged. [readability/streams] [3] /b/sanitizer-x86_64-linux-autoconf/build/llvm/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp:11: Streams are highly discouraged. [readability/streams] [3] lib/CMakeFiles/SanitizerLintCheck.dir/build.make:57: recipe for target 'lib/CMakeFiles/SanitizerLintCheck' failed I do not know why this apparently wasn't a problem when the files had extension .cc. llvm-svn: 367493
* compiler-rt: Rename .cc file in lib/sanitizer_common/tests to .cppNico Weber2019-07-3135-68/+71
| | | | | | | | | | | 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 $(basename $f) . ; done and manually updated references to renamed files found by that. llvm-svn: 367467
* compiler-rt: Rename .cc file in lib/sanitizer_common to .cppNico Weber2019-07-312-2/+2
| | | | | | | | | | | 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
* [compiler-rt][tests] Propagate COMPILER_RT_UNITTEST_LINK_FLAGSHubert Tong2019-05-011-0/+2
| | | | | | | | | | | | | | | | | | | | `COMPILER_RT_UNITTEST_LINK_FLAGS` is dropped in many places, unlike `COMPILER_RT_UNITTEST_CFLAGS`. This patch attempts to remove that inconsistency. Previously reviewed as part of D58951. Reviewers: sfertile, peter.smith, pzheng, phosek, Hahnfeld, nemanjai, jasonliu Reviewed By: sfertile Subscribers: jsji, kubamracek, dberris, mgorny, delcypher, jdoerfert, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60143 llvm-svn: 359733
* [sanitizer][NFC] Remove unneeded SizeClassAllocatorLocalCacheVitaly Buka2019-05-011-21/+16
| | | | llvm-svn: 359729
* [sanitizer][NFC] Set LargeMmapAllocator type from PrimaryAllocatorVitaly Buka2019-05-012-9/+8
| | | | | | | | | | | | | | They need to have same AddressSpaceView and MapUnmapCallback. Reviewers: eugenis Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61168 llvm-svn: 359719
* [sanitizer][NFC] Get type of AllocatorCache from CombinedAllocatorVitaly Buka2019-05-012-24/+10
| | | | | | | | | | | | | | Reviewers: eugenis, cryptoad, kcc Reviewed By: kcc Subscribers: kcc, kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61155 llvm-svn: 359715
* Added test.Mitch Phillips2019-04-301-0/+16
| | | | llvm-svn: 359632
* [sanitizer] Calculate SizeClassAllocator32::ByteMap type from ↵Vitaly Buka2019-04-271-8/+3
| | | | | | | | | | | | | | Params::kSpaceSize and Params::kRegionSizeLog Reviewers: eugenis Subscribers: kubamracek, cryptoad, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61206 llvm-svn: 359374
* Implement __sanitizer::conditional<B, T, F>Vitaly Buka2019-04-261-0/+5
| | | | llvm-svn: 359334
* [NFC] Remove ::kForTest from AP64, it does not use it.Vitaly Buka2019-04-261-7/+7
| | | | llvm-svn: 359323
* [lsan] Use SANITIZER_WORDSIZE when selecting ByteMapVitaly Buka2019-04-261-10/+11
| | | | | | | Originally this code was added for 64-bit platform and it was never update. Add static_assert to validate type of ByteMap. llvm-svn: 359286
* Revert "[lsan] Use SANITIZER_WORDSIZE when selecting ByteMap"Vitaly Buka2019-04-261-11/+10
| | | | | | | | New static_assert fails on a bot. This reverts commit r359269. llvm-svn: 359276
* [lsan] Use SANITIZER_WORDSIZE when selecting ByteMapVitaly Buka2019-04-261-10/+11
| | | | | | | Originally this code as added for 64-bit platform and was never changed. Add static_assert to make sure that we have correct map on all platforms. llvm-svn: 359269
* [NFC][Sanitizer] Replace last uses of old Unwind APIJulian Lettner2019-03-011-25/+22
| | | | | | | | | | | | | Replace remaining uses of old Unwind API in unit tests. Allows us to remove the old API and WillUseFastUnwind can be made private. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D58754 llvm-svn: 355242
* Revert "Revert "[sanitizers] Restore internal_readlink for x32""H.J. Lu2019-02-281-0/+8
| | | | | | | | | This reverts revision 354601 and disables ReadBinaryNameCached check on Windows since Windows has no working ReadBinaryName. Differential Revision: https://reviews.llvm.org/D58788 llvm-svn: 355129
* [NFC][Sanitizer] Rename BufferedStackTrace::FastUnwindStackJulian Lettner2019-02-221-2/+2
| | | | | | | | | | | | | | | | FastUnwindStack -> UnwindFast SlowUnwindStack -> UnwindSlow Stack is redundant, verb should come first. SlowUnwindStackWithContext(uptr pc, void *context, u32 max_depth) -> SlowUnwindStack WithContext is redundant, since it is a required parameter. Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D58551 llvm-svn: 354696
* Revert "[sanitizers] Restore internal_readlink for x32"Matt Morehouse2019-02-211-5/+0
| | | | | | This reverts r354451 since it broke the Windows sanitizer bot. llvm-svn: 354601
* [sanitizers] Restore internal_readlink for x32H.J. Lu2019-02-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | r316591 has @@ -389,13 +383,11 @@ uptr internal_dup2(int oldfd, int newfd) { } uptr internal_readlink(const char *path, char *buf, uptr bufsize) { -#if SANITIZER_NETBSD - return internal_syscall_ptr(SYSCALL(readlink), path, buf, bufsize); -#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS +#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(readlinkat), AT_FDCWD, (uptr)path, (uptr)buf, bufsize); #else - return internal_syscall(SYSCALL(readlink), (uptr)path, (uptr)buf, bufsize); + return internal_syscall_ptr(SYSCALL(readlink), path, buf, bufsize); #endif } which dropped the (uptr) cast and broke x32. This patch puts back the (uptr) cast to restore x32 and fixes: https://bugs.llvm.org/show_bug.cgi?id=40783 Differential Revision: https://reviews.llvm.org/D58413 llvm-svn: 354451
* [sanitizers] add a regression test for the bug fixed in r354366Kostya Serebryany2019-02-191-0/+6
| | | | llvm-svn: 354373
* Fix invalid code that Clang trunk will soon diagnose.Richard Smith2019-02-151-1/+1
| | | | | | | | | | | | | There is an ambiguity between ::SizeClassMap (the typedef declared near the start of this file) and __sanitizer::SizeClassMap (found by the 'using namespace __sanitizer;' near the start of this file). Historically a Clang bug has meant that the error was not diagnosed, but soon Clang will start diagnosing it. Explicitly qualify this use of SizeClassMap so that it finds __sanitizer::SizeClassMap rather than being ill-formed due to ambiguity. llvm-svn: 354174
* sanitizers: Introduce ThreadType enumDmitry Vyukov2019-02-071-6/+7
| | | | | | | | | | | | | Replace bool workerthread flag with ThreadType enum. This change is preparation for fiber support. [dvyukov: fixed build of sanitizer_thread_registry_test.cc] Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D57839 Context: https://reviews.llvm.org/D54889 llvm-svn: 353390
* [compiler-rt] Fix reporting unrecognized flags in unit tests.Igor Kudrin2019-01-291-0/+3
| | | | | | | | Previously, the warning messages might be issued within a wrong test case. Differential Revision: https://reviews.llvm.org/D57318 llvm-svn: 352447
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1935-140/+105
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Introduce `AddressSpaceView` template parameter to `SizeClassAllocator64`.Dan Liew2018-12-211-7/+39
| | | | | | | | | | | | | | | | | | | | | | Summary: This is a follow up patch to r349138. This patch makes a `AddressSpaceView` a type declaration in the allocator parameters used by `SizeClassAllocator64`. For ASan, LSan, and the unit tests the AP64 declarations have been made templated so that `AddressSpaceView` can be changed at compile time. For the other sanitizers we just hard-code `LocalAddressSpaceView` because we have no plans to use these allocators in an out-of-process manner. rdar://problem/45284065 Reviewers: kcc, dvyukov, vitalybuka, cryptoad, eugenis, kubamracek, george.karpenkov Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D55764 llvm-svn: 349954
* Introduce `AddressSpaceView` template parameter to `SizeClassAllocator32`, ↵Dan Liew2018-12-141-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `FlatByteMap`, and `TwoLevelByteMap`. Summary: This is a follow up patch to r346956 for the `SizeClassAllocator32` allocator. This patch makes `AddressSpaceView` a template parameter both to the `ByteMap` implementations (but makes `LocalAddressSpaceView` the default), some `AP32` implementations and is used in `SizeClassAllocator32`. The actual changes to `ByteMap` implementations and `SizeClassAllocator32` are very simple. However the patch is large because it requires changing all the `AP32` definitions, and users of those definitions. For ASan and LSan we make `AP32` and `ByteMap` templateds type that take a single `AddressSpaceView` argument. This has been done because we will instantiate the allocator with a type that isn't `LocalAddressSpaceView` in the future patches. For the allocators used in the other sanitizers (i.e. HWAsan, MSan, Scudo, and TSan) use of `LocalAddressSpaceView` is hard coded because we do not intend to instantiate the allocators with any other type. In the cases where untemplated types have become templated on a single `AddressSpaceView` parameter (e.g. `PrimaryAllocator`) their name has been changed to have a `ASVT` suffix (Address Space View Type) to indicate they are templated. The only exception to this are the `AP32` types due to the desire to keep the type name as short as possible. In order to check that template is instantiated in the correct a way a `static_assert(...)` has been added that checks that the `AddressSpaceView` type used by `Params::ByteMap::AddressSpaceView` matches the `Params::AddressSpaceView`. This uses the new `sanitizer_type_traits.h` header. rdar://problem/45284065 Reviewers: kcc, dvyukov, vitalybuka, cryptoad, eugenis, kubamracek, george.karpenkov Subscribers: mgorny, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D54904 llvm-svn: 349138
* Implement a small subset of the C++ `type_traits` header inside ↵Dan Liew2018-12-132-0/+29
| | | | | | | | | | | | | | | | | | sanitizer_common so we can avoid depending on system C++ headers. Summary: In particular we implement the `is_same<T,U>` templated type. This is useful for doing compile-time comparison of types in `static_assert`s. The plan is to use this in another patch ( https://reviews.llvm.org/D54904 ). Reviewers: kcc, dvyukov, vitalybuka, cryptoad, eugenis, kubamracek, george.karpenkov Subscribers: mgorny, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D54951 llvm-svn: 349077
* [SanitizerCommon] Test `CombinedAllocator::ForEachChunk()` in unit tests.Dan Liew2018-12-041-0/+16
| | | | | | | | | | | | | | Summary: Previously we weren't testing this function in the unit tests. Reviewers: kcc, cryptoad, dvyukov, eugenis, kubamracek Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D54861 llvm-svn: 348260
* Fix filtering of sanitizer_common unittest architectures on Darwin.Kuba Mracek2018-11-271-1/+1
| | | | llvm-svn: 347622
* [asan] Remove stale -fno-exceptions flag in sanitizer_common as wellReid Kleckner2018-10-311-5/+0
| | | | llvm-svn: 345685
* [sanitizer] Disable failing Android test after D52371Kostya Kortchinsky2018-09-271-4/+5
| | | | | | | | | | | | | | | | | Summary: The default values used for Space/Size for the new SizeClassMap do not work with Android. The Compact map appears to be in the same boat. Disable the test on Android for now to turn the bots green, but there is no reason Compact & Dense should not have an Android test. Added a FIXME, I will revisit this soon. Reviewers: eugenis Subscribers: srhines, kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D52623 llvm-svn: 343252
* [sanitizer] Introduce a new SizeClassMap with minimal amount of cached entriesKostya Kortchinsky2018-09-271-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: _Note_: I am not attached to the name `DenseSizeClassMap`, so if someone has a better idea, feel free to suggest it. The current pre-defined `SizeClassMap` hold a decent amount of cached entries, either in cheer number of, or in amount of memory cached. Empirical testing shows that more compact per-class arrays (whose sizes are directly correlated to the number of cached entries) are beneficial to performances, particularly in highly threaded environments. The new proposed `SizeClassMap` has the following properties: ``` c00 => s: 0 diff: +0 00% l 0 cached: 0 0; id 0 c01 => s: 16 diff: +16 00% l 4 cached: 8 128; id 1 c02 => s: 32 diff: +16 100% l 5 cached: 8 256; id 2 c03 => s: 48 diff: +16 50% l 5 cached: 8 384; id 3 c04 => s: 64 diff: +16 33% l 6 cached: 8 512; id 4 c05 => s: 80 diff: +16 25% l 6 cached: 8 640; id 5 c06 => s: 96 diff: +16 20% l 6 cached: 8 768; id 6 c07 => s: 112 diff: +16 16% l 6 cached: 8 896; id 7 c08 => s: 128 diff: +16 14% l 7 cached: 8 1024; id 8 c09 => s: 144 diff: +16 12% l 7 cached: 7 1008; id 9 c10 => s: 160 diff: +16 11% l 7 cached: 6 960; id 10 c11 => s: 176 diff: +16 10% l 7 cached: 5 880; id 11 c12 => s: 192 diff: +16 09% l 7 cached: 5 960; id 12 c13 => s: 208 diff: +16 08% l 7 cached: 4 832; id 13 c14 => s: 224 diff: +16 07% l 7 cached: 4 896; id 14 c15 => s: 240 diff: +16 07% l 7 cached: 4 960; id 15 c16 => s: 256 diff: +16 06% l 8 cached: 4 1024; id 16 c17 => s: 320 diff: +64 25% l 8 cached: 3 960; id 49 c18 => s: 384 diff: +64 20% l 8 cached: 2 768; id 50 c19 => s: 448 diff: +64 16% l 8 cached: 2 896; id 51 c20 => s: 512 diff: +64 14% l 9 cached: 2 1024; id 48 c21 => s: 640 diff: +128 25% l 9 cached: 1 640; id 49 c22 => s: 768 diff: +128 20% l 9 cached: 1 768; id 50 c23 => s: 896 diff: +128 16% l 9 cached: 1 896; id 51 c24 => s: 1024 diff: +128 14% l 10 cached: 1 1024; id 48 c25 => s: 1280 diff: +256 25% l 10 cached: 1 1280; id 49 c26 => s: 1536 diff: +256 20% l 10 cached: 1 1536; id 50 c27 => s: 1792 diff: +256 16% l 10 cached: 1 1792; id 51 c28 => s: 2048 diff: +256 14% l 11 cached: 1 2048; id 48 c29 => s: 2560 diff: +512 25% l 11 cached: 1 2560; id 49 c30 => s: 3072 diff: +512 20% l 11 cached: 1 3072; id 50 c31 => s: 3584 diff: +512 16% l 11 cached: 1 3584; id 51 c32 => s: 4096 diff: +512 14% l 12 cached: 1 4096; id 48 c33 => s: 5120 diff: +1024 25% l 12 cached: 1 5120; id 49 c34 => s: 6144 diff: +1024 20% l 12 cached: 1 6144; id 50 c35 => s: 7168 diff: +1024 16% l 12 cached: 1 7168; id 51 c36 => s: 8192 diff: +1024 14% l 13 cached: 1 8192; id 48 c37 => s: 10240 diff: +2048 25% l 13 cached: 1 10240; id 49 c38 => s: 12288 diff: +2048 20% l 13 cached: 1 12288; id 50 c39 => s: 14336 diff: +2048 16% l 13 cached: 1 14336; id 51 c40 => s: 16384 diff: +2048 14% l 14 cached: 1 16384; id 48 c41 => s: 20480 diff: +4096 25% l 14 cached: 1 20480; id 49 c42 => s: 24576 diff: +4096 20% l 14 cached: 1 24576; id 50 c43 => s: 28672 diff: +4096 16% l 14 cached: 1 28672; id 51 c44 => s: 32768 diff: +4096 14% l 15 cached: 1 32768; id 48 c45 => s: 40960 diff: +8192 25% l 15 cached: 1 40960; id 49 c46 => s: 49152 diff: +8192 20% l 15 cached: 1 49152; id 50 c47 => s: 57344 diff: +8192 16% l 15 cached: 1 57344; id 51 c48 => s: 65536 diff: +8192 14% l 16 cached: 1 65536; id 48 c49 => s: 81920 diff: +16384 25% l 16 cached: 1 81920; id 49 c50 => s: 98304 diff: +16384 20% l 16 cached: 1 98304; id 50 c51 => s: 114688 diff: +16384 16% l 16 cached: 1 114688; id 51 c52 => s: 131072 diff: +16384 14% l 17 cached: 1 131072; id 48 c53 => s: 64 diff: +0 00% l 0 cached: 8 512; id 4 Total cached: 864928 (152/432) ``` It holds a bit less of 1MB of cached entries at most, and the cache fits in a page. The plan is to use this map by default for Scudo once we make sure that there is no unforeseen impact for any of current use case. Benchmarks give the most increase in performance (with Scudo) when looking at highly threaded/contentious environments. For example, rcp2-benchmark experiences a 10K QPS increase (~3%), and a decrease of 50MB for the max RSS (~10%). On platforms like Android where we only have a couple of caches, performance remain similar. Reviewers: eugenis, kcc Reviewed By: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D52371 llvm-svn: 343246
* [hwasan] Record and display stack history in stack-based reports.Evgeniy Stepanov2018-09-241-0/+22
| | | | | | | | | | | | | | | | | | | | | Summary: Display a list of recent stack frames (not a stack trace!) when tag-mismatch is detected on a stack address. The implementation uses alignment tricks to get both the address of the history buffer, and the base address of the shadow with a single 8-byte load. See the comment in hwasan_thread_list.h for more details. Developed in collaboration with Kostya Serebryany. Reviewers: kcc Subscribers: srhines, kubamracek, mgorny, hiraditya, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D52249 llvm-svn: 342923
* Revert "[hwasan] Record and display stack history in stack-based reports."Evgeniy Stepanov2018-09-241-22/+0
| | | | | | This reverts commit r342921: test failures on clang-cmake-arm* bots. llvm-svn: 342922
* [hwasan] Record and display stack history in stack-based reports.Evgeniy Stepanov2018-09-241-0/+22
| | | | | | | | | | | | | | | | | | | | | Summary: Display a list of recent stack frames (not a stack trace!) when tag-mismatch is detected on a stack address. The implementation uses alignment tricks to get both the address of the history buffer, and the base address of the shadow with a single 8-byte load. See the comment in hwasan_thread_list.h for more details. Developed in collaboration with Kostya Serebryany. Reviewers: kcc Subscribers: srhines, kubamracek, mgorny, hiraditya, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D52249 llvm-svn: 342921
* [sanitizer] reapply r340884 'Add a RingBuffer class to sanitizer_common', ↵Kostya Serebryany2018-08-292-0/+78
| | | | | | with fixes for Windows llvm-svn: 340969
* Revert r340884 "Add a RingBuffer class to sanitizer_common"Hans Wennborg2018-08-292-85/+0
| | | | | | | | | | | | | | | | | | | The test doesn't pass on Windows, where sizeof(long) == 4 also on 64-bit, and so it isn't a multiple of sizeof(void*). This also reverts the follow-up r340886. > Summary: a constrained RingBuffer optimized for fast push > > Reviewers: eugenis > > Reviewed By: eugenis > > Subscribers: kubamracek, mgorny, delcypher, #sanitizers, llvm-commits > > Differential Revision: https://reviews.llvm.org/D51196 llvm-svn: 340924
* [sanitizer] fix a testKostya Serebryany2018-08-281-19/+20
| | | | llvm-svn: 340886
* Add a RingBuffer class to sanitizer_commonKostya Serebryany2018-08-282-0/+84
| | | | | | | | | | | | | | Summary: a constrained RingBuffer optimized for fast push Reviewers: eugenis Reviewed By: eugenis Subscribers: kubamracek, mgorny, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D51196 llvm-svn: 340884
* [Sanitizer] implementing remaining function under OSXDavid Carlier2018-08-241-1/+2
| | | | | | | | | | | | | - GetRandom and GetnumberOfCPUs using sys call for the former. - enabling unit tests for the other oses. Reviewers: kubamracek Reviewed By: kubamracek Differential Revision: https://reviews.llvm.org/D50937 llvm-svn: 340621
* [CMake] Rename `SANITIZER_HEADERS` to `SANITIZER_IMPL_HEADERS` under ↵Dan Liew2018-07-121-1/+1
| | | | | | | | | | | | | `lib/sanitizer_common`. The variable name `SANITIZER_HEADERS` is already used for the list of public headers in `include/CMakeLists.txt`. Although the previous implementation worked it's probably best to avoid shadowing global variables to avoid confusion. Differential Revision: https://reviews.llvm.org/D49176 llvm-svn: 336904
OpenPOWER on IntegriCloud