summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-08-10Enable SafeStack on NetBSDKamil Rytarowski
Summary: make check-safestack: -- Testing: 8 tests, 8 threads -- Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. Testing Time: 0.44s Expected Passes : 7 Unsupported Tests : 1 Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, fjricci, filcab Reviewed By: vitalybuka Subscribers: mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36542 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310646 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08Enable ubsan on NetBSDKamil Rytarowski
Summary: Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, filcab, fjricci Reviewed By: fjricci Subscribers: srhines, kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36483 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310412 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-07[asan] Make dump_registers.cc more stableKuba Mracek
Differential Revision: https://reviews.llvm.org/D36231 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310273 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-04[asan] Fix unsupported test on AndroidKostya Kortchinsky
Summary: `pvalloc` appears to not be available on Android. Mark the failing test as unsupported on that platform. Reviewers: alekseyshl, vitalybuka Reviewed By: alekseyshl, vitalybuka Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D36339 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310133 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-04[asan] Check for pvalloc overlowKostya Kortchinsky
Summary: Last one of the `pvalloc` overflow checks! `CheckForPvallocOverflow` was introduced with D35818 to detect when `pvalloc` would wrap when rounding up to the next multiple of the page size. Add this check to ASan's `pvalloc` implementation. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D36257 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310119 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-04[msan] Switch the pvalloc overflow test to a lit testBenjamin Kramer
The test was not passing on targets where allocator_may_return_null defaults to true. Change the test to a lit test so that we can test both situations. Patch by Kostya Kortchinsky! Differential Revision: https://reviews.llvm.org/D36302 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310033 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-04coverage: Update tests to reflect changes from r310012Vedant Kumar
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310015 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03These tests use 80-bit long doubles, which are x86 only. Mark them so.Sterling Augustine
This avoids having each new target need to mark them as unsupported. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309973 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02Use a more standard method to mark these tests as unsupported on powerpc64.Sterling Augustine
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309892 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02Add new ASAN_OPTION: sleep_after_init.Kostya Serebryany
Summary: As mentioned in https://github.com/google/sanitizers/issues/834, suggested option can be handy for debugging. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D35409 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02[ubsan] Test -fsanitize=vptr without -fsanitize=nullVedant Kumar
This reverts commit r309042, thereby adding a test for -fsanitize=vptr functionality without -fsanitize=null. It also removes -fsanitize=null from another -fsanitize=vptr test. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309847 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-31[sancov] Fix coverage-reset test on Android/i686.Evgeniy Stepanov
DSO coverage may be dumped in any order. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309639 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-31[XRay][compiler-rt] Fix test to not be too strict with output order.Dean Michael Berris
Follow-up to D35789. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309543 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-31[XRay][compiler-rt] Fix typo for REQUIRES.Dean Michael Berris
Follow-up on D35789. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309540 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-31[XRay][compiler-rt] Require build-in-tree and x86_64-linux.Dean Michael Berris
The quiet-start.cc test currently fails for arm (and potentially other platforms). This change limits it to x86_64-linux. Follow-up to D35789. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309538 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-31[XRay][compiler-rt] Do not print the warning when the binary is not XRay ↵Dean Michael Berris
instrumented. Summary: Currently when the XRay runtime is linked into a binary that doesn't have the instrumentation map, we print a warning unconditionally. This change attempts to make this behaviour more quiet. Reviewers: kpw, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35789 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309534 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29[ubsan] Diagnose invalid uses of builtins (compiler-rt)Vedant Kumar
Differential Revision: https://reviews.llvm.org/D34591 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309461 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28Try to fix asan test on sanitizer-windowsReid Kleckner
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309440 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28Add end-to-end tests for overflows of byval arguments.Matt Morehouse
Summary: Included is one test for passing structs by value and one test for passing C++ objects by value. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D34827 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28Add clear_cache implementation for ppc64. Fix buffer to meet ppc64 alignment.Sterling Augustine
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309423 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28[sanitizer-coverage] add a run-time test for ↵Kostya Serebryany
-fsanitize-coverage=inline-8bit-counters,pc-table git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309351 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28[sancov] Add missing line breaks in test. NFC.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309339 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-27[sancov] Implement __sanitizer_cov_reset.Evgeniy Stepanov
Summary: Clears all collected coverage. Reviewers: kcc Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D35958 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309333 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25[ubsan] Update a test missed in r309008, NFCVedant Kumar
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309042 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25[scudo] Check for pvalloc overflowKostya Kortchinsky
Summary: Previously we were rounding up the size passed to `pvalloc` to the next multiple of page size no matter what. There is an overflow possibility that wasn't accounted for. So now, return null in the event of an overflow. The man page doesn't seem to indicate the errno to set in this particular situation, but the glibc unit tests go for ENOMEM (https://code.woboq.org/userspace/glibc/malloc/tst-pvalloc.c.html#54) so we'll do the same. Update the aligned allocation funtions tests to check for properly aligned returned pointers, and the `pvalloc` corner cases. @alekseyshl: do you want me to do the same in the other Sanitizers? Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: kubamracek, alekseyshl, llvm-commits Differential Revision: https://reviews.llvm.org/D35818 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309033 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25[ubsan] -fsanitize=vptr now requires -fsanitize=null, update testsVedant Kumar
See: https://bugs.llvm.org/show_bug.cgi?id=33881 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309008 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25Revert "[compiler-rt] Include thread ID into sanitizers logs"Vitaly Buka
This improvement introduce additional dependencies on sandboxed environments. This reverts commit r308637. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308984 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-24Splitting out test for Darwin for print-stack-trace:George Karpenkov
New default symbolizer can not symbolize inlined function which appear under -O3. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308925 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-24Prefer atos to llvm-symbolizer on DarwinGeorge Karpenkov
atos is the default symbolizer on Apple's compiler for quite a few years now. llvm-symbolizer is quite fragile on Darwin: for example, unless a .dSYM file was explicitly generated symbolication would not work. It is also very convenient when the behavior of LLVM open source compiler matches to that of Apple's compiler on Apple's platform. Furthermore, llvm-symbolizer is not installed on Apple's platform by default, which leads to strange behavior during debugging: the test might fail under lit (where it has llvm-symbolizer) but would run properly when launched on the command line (where it does not, and atos would be used). Indeed, there's a downside: atos does not work properly with inlined functions, hence the test change. We do not think that this is a major problem, as users would often compile with -O0 when debugging, and in any case it is preferable to symbolizer not being able to symbolize. Differential Revision: https://reviews.llvm.org/D35745 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308908 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-24[scudo] Fix QuarantineChunksUpToSize failing test on AArch64Kostya Kortchinsky
Summary: Warm-up the other 2 sizes used by the tests, which should get rid of a failure on AArch64. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: aemerson, rengolin, llvm-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D35806 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308907 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-24[scudo] Quarantine overhaulKostya Kortchinsky
Summary: First, some context. The main feedback we get about the quarantine is that it's too memory hungry. A single MB of quarantine will have an impact of 3 to 4MB of PSS/RSS, and things quickly get out of hand in terms of memory usage, and the quarantine ends up disabled. The main objective of the quarantine is to protect from use-after-free exploitation by making it harder for an attacker to reallocate a controlled chunk in place of the targeted freed chunk. This is achieved by not making it available to the backend right away for reuse, but holding it a little while. Historically, what has usually been the target of such attacks was objects, where vtable pointers or other function pointers could constitute a valuable targeti to replace. Those are usually on the smaller side. There is barely any advantage in putting the quarantine several megabytes of RGB data or the like. Now for the patch. This patch introduces a new way the Quarantine behaves in Scudo. First of all, the size of the Quarantine will be defined in KB instead of MB, then we introduce a new option: the size up to which (lower than or equal to) a chunk will be quarantined. This way, we only quarantine smaller chunks, and the size of the quarantine remains manageable. It also prevents someone from triggering a recycle by allocating something huge. We default to 512 bytes on 32-bit and 2048 bytes on 64-bit platforms. In details, the patches includes the following: - introduce `QuarantineSizeKb`, but honor `QuarantineSizeMb` if set to fall back to the old behavior (meaning no threshold in that case); `QuarantineSizeMb` is described as deprecated in the options descriptios; documentation update will follow; - introduce `QuarantineChunksUpToSize`, the new threshold value; - update the `quarantine.cpp` test, and other tests using `QuarantineSizeMb`; - remove `AllocatorOptions::copyTo`, it wasn't used; - slightly change the logic around `quarantineOrDeallocateChunk` to accomodate for the new logic; rename a couple of variables there as well; Rewriting the tests, I found a somewhat annoying bug where non-default aligned chunks would account for more than needed when placed in the quarantine due to `<< MinAlignment` instead of `<< MinAlignmentLog`. This is fixed and tested for now. Reviewers: alekseyshl, kcc Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35694 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-21Remove Bitrig: CompilerRT ChangesErich Keane
Bitrig code has been merged back to OpenBSD, thus the OS has been abandoned. Differential Revision: https://reviews.llvm.org/D35709 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308798 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-21[XRay][compiler-rt] Update test to account for change in logging format.Dean Michael Berris
Fixes build breakage for some bots after we've started logging both the process id and the thread id. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308701 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-20[tsan] Update unittest for logging changes of r308637Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308660 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-20[asan] Update unittest for changes in logging r308637Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308647 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-20[compiler-rt] Include thread ID into sanitizers logsVitaly Buka
Reviewers: kcc, alekseyshl Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D35654 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308637 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-18[Sanitizers] ASan/MSan/LSan allocators set errno on failure.Alex Shlyapnikov
Summary: ASan/MSan/LSan allocators set errno on allocation failures according to malloc/calloc/etc. expected behavior. MSan allocator was refactored a bit to make its structure more similar with other allocators. Also switch Scudo allocator to the internal errno definitions. TSan allocator changes will follow. Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D35275 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308344 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16[asan] Disable not working new test on WindowsVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308123 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16[msan] Add missing include for fix test on WindowsVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308122 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-14[Sanitizers] ASan and LSan allocator set errno on failure.Alex Shlyapnikov
Summary: Set proper errno code on alloction failures and change some implementations to satisfy their man-specified requirements: LSan: valloc and memalign ASan: pvalloc, memalign and posix_memalign Changing both allocators in one patch since LSan depends on ASan allocator in some configurations. Reviewers: vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D35440 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308064 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14[Sanitizers] LSan allocator set errno on failure.Alex Shlyapnikov
Set proper errno code on alloction failures and change valloc and memalign implementations to satisfy their man-specified requirements. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308063 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14[Sanitizers] Scudo allocator set errno on failure.Alex Shlyapnikov
Summary: Set proper errno code on alloction failure and change pvalloc and posix_memalign implementation to satisfy their man-specified requirements. Reviewers: cryptoad Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35429 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308053 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13[ubsan] Teach the pointer overflow check that "p - <unsigned> <= p" ↵Vedant Kumar
(compiler-rt) Compiler-rt changes associated with: D34121 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307956 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13Fix broken testXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307869 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12[asan] Avoid recompilation of the same code in the testVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307868 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12[PGO] Add a test for 2-deep loop nestXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307864 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