summaryrefslogtreecommitdiff
path: root/test/asan
AgeCommit message (Collapse)Author
2017-11-17Enable PDB generation with lld in asan and cfi tests on Windows.Peter Collingbourne
PDB emission now works well enough that we can rely on it for these tests to pass. Differential Revision: https://reviews.llvm.org/D40188 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318546 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16[asan] Properly mark or disable tests that only work with shadow scale of 3Walter Lee
Differential Revision: https://reviews.llvm.org/D39774 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318471 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16[asan] Port tests to shadow scale of 5Walter Lee
The tests are ported as follows: contiguous_container_crash.cc use-after-delete.cc use-after-free.cc Replace hardwired shadow granularity in CHECK statements with regex. max_redzone.cc Bump max_redzone parameter to 32. memset_test.cc Bump size parameter of __asan_poison_memory_region to 32. scariness_score_test.cc For "far-from-bounds" heap overflow, make sure overflow is more than one shadow granularity away. At large shadow granularity, there is not enough redzone between stack elements to detect far-from-bounds, so fake out that test. Differential Revision: https://reviews.llvm.org/D39773 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318470 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09Revert new ThinLTO ASAN test until lit support addedTeresa Johnson
This reverts commit r317723 and r317728. Will be re-added when support for LTO/ThinLTO added to test/asan/lit.cfg. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317823 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08[ThinLTO] New test needs to require LTOTeresa Johnson
Fix buildbot failures: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/5262/steps/annotate/logs/stdio git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08[ThinLTO] Ensure sanitizer passes are runTeresa Johnson
Recommit new test as linux-only. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317723 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08Revert "[ThinLTO] Ensure sanitizer passes are run"Teresa Johnson
This reverts commit r317715. It failed a Windows buildbot since ThinLTO is presumably not supported, leading to a corrupt file error on the object file: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/19395/steps/run%20check-asan/logs/stdio Will re-commit the new ThinLTO part of the test to a linux only test file. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317717 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08[ThinLTO] Ensure sanitizer passes are runTeresa Johnson
Summary: Test fix to pass manager for ThinLTO. Depends on D39565. Reviewers: pcc Subscribers: kubamracek, mehdi_amini, llvm-commits, inglorion Differential Revision: https://reviews.llvm.org/D39566 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317715 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-25[Sanitizers] ASan: detect new/delete calls with mismatched alignment.Alex Shlyapnikov
ASan allocator stores the requested alignment for new and new[] calls and on delete and delete[] verifies that alignments do match. The representable alignments are: default alignment, 8, 16, 32, 64, 128, 256 and 512 bytes. Alignments > 512 are stored as 512, hence two different alignments > 512 will pass the check (possibly masking the bug), but limited memory requirements deemed to be a resonable tradeoff for relaxed conditions. The feature is controlled by new_delete_type_mismatch flag, the same one protecting new/delete matching size check. Differential revision: https://reviews.llvm.org/D38574 Issue: https://github.com/google/sanitizers/issues/799 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316595 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-23[Sanitizers] New sanitizer API to purge allocator quarantine.Alex Shlyapnikov
Summary: Purging allocator quarantine and returning memory to OS might be desired between fuzzer iterations since, most likely, the quarantine is not going to catch bugs in the code under fuzz, but reducing RSS might significantly prolong the fuzzing session. Reviewers: cryptoad Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D39153 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316347 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10Factor out "stable-runtime" feature and enable it on all android.Evgeniy Stepanov
This is a very poorly named feature. I think originally it meant to cover linux only, but the use of it in msan seems to be about any aarch64 platform. Anyway, this change should be NFC on everything except Android. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315389 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-06Factor out default_(a|ub)sanitizer_opts in lit.Evgeniy Stepanov
Reviewers: vitalybuka Subscribers: srhines, llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D38644 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315106 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05[sanitizer] Move %ld_flags_rpath_exe to common and use it in more tests.Evgeniy Stepanov
Reviewers: vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D38527 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315010 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-27ASan allocates a global data initialization array at the tail end of eachDmitry Mikulin
compunit's .data section. This vector is not poisoned. Because of this the first symbol of the following section has no left red zone. As a result, ASan cannot detect underflow for such symbols. Poison ASan allocated metadata, it should not be accessible to user code. This fix does not eliminate the problem with missing left red zones but it reduces the set of vulnerable symbols from first symbols in each input data section to first symbols in the output section of the binary. Differential Revision: https://reviews.llvm.org/D38056 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314365 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-26[mips][asan] Fix preinstalled_signal.cc test for mipsSimon Dardis
Linux for mips has a non-standard layout for the kernel sigaction struct. Adjust the layout by the minimally amount to get the test to pass, as we don't require the usage of the restorer function. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314200 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22[asan/lsan] Trying to fix PPC64 and x380x buildbots after r313966Maxim Ostapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313974 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22[asan/lsan] Trying to fix buildbots after r313966Maxim Ostapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313967 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22[asan/lsan] Make LSan compliant with recovery mode when running on top of ASanMaxim Ostapenko
Don't overwrite exit code in LSan when running on top of ASan in recovery mode to avoid breakage of users code due to found leaks. Patch by Slava Barinov. Differential Revision: https://reviews.llvm.org/D38026 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313966 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21[asan] Remove trailing spacesVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313845 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21[asan] Remove "COLLISION" workaround for datarace in asanVitaly Buka
"nested bug in the same thread" is not expected in case like this and was caused by https://github.com/google/sanitizers/issues/858 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21[asan] Remove "rm -f" in tests where it was needed only because of >>Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313843 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20[asan] Fix nested error detectionVitaly Buka
Summary: Fixes https://github.com/google/sanitizers/issues/858 Reviewers: eugenis, dvyukov Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D38019 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313835 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20[asan] Try to fix windows test by fflush(stderr)Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20[asan] Resolve FIXME by converting gtest into lit testVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313727 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18[ubsan] Fix interface_symbols_windows testVitaly Buka
Summary: 1. Update ubsan_interface.inc to make the test happy. 2. Switch interface_symbols_linux and interface_symbols_darwin to C++ to import __ubsan_handle_dynamic_type_cache_miss 3. Switch interface_symbols_windows to C++ for consistency. Reviewers: rnk, zturner Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37986 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313551 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17Mark various failing tests with "UNSUPPORTED: ios".Kuba Mracek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313498 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16[sanitizer] Support check-asan on AndroidVitaly Buka
This patch enabled asan tests from sanitizer_common. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313444 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16[sanitizer] Move android_commoands from asan into sanitizer_commonVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313443 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16[asan] Remove not-androidVitaly Buka
Replaced with !android git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313440 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16[asan] Enable asan_and_llvm_coverage_test.cc on AndroidVitaly Buka
Test just needs profile. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313438 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[asan] Disable two dynamic tests on armhfVitaly Buka
This is not an regression. Tests are old and we just recently started to run them on bots with dynamic runtime. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313283 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13[compiler-rt] Move dump_instruction_bytes and dump_registers into ↵Vitaly Buka
sanitizer_common Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D37766 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313117 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[asan] Include asan-dynamic into check-allVitaly Buka
Summary: It's adds just 1k to about 45k tests. Reviewers: eugenis, alekseyshl Subscribers: kubamracek, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D37666 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312937 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09[asan] Fix tests broken by r312858Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312872 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09[compiler-rt] Move allow_user_segv.cc into sanitizer_commonVitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis Subscribers: kubamracek, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D37537 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09[asan] Use more generic string in error messageVitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37609 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312858 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-30Finalize ASAN/NetBSDKamil Rytarowski
Summary: This revision contains various cleanups. Sponsored by <The NetBSD Foundation> Reviewers: kcc, vitalybuka, joerg, eugenis Reviewed By: kcc Subscribers: emaste, srhines, llvm-commits, kubamracek, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D37244 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312188 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-30[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzerMatt Morehouse
Summary: - Don't sanitize __sancov_lowest_stack. - Don't instrument leaf functions. - Add CoverageStackDepth to Fuzzer and FuzzerNoLink. - Only enable on Linux. Reviewers: vitalybuka, kcc, george.karpenkov Reviewed By: kcc Subscribers: kubamracek, cfe-commits, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D37156 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312185 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-29[asan] Add use-after-scope test which fails because of bug in clangVitaly Buka
Reviewers: kcc, eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37242 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312039 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-28Reland r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny
Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311924 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-27Revert r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny
The required change in clang is being reverted because of the Android build bot failure. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-27[cmake] Remove i686 target that is duplicate to i386Michal Gorny
Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-24Mark allocator_oom_test.cc unsupported on arm & aarch64 (PR33972)Hans Wennborg
The buildbots don't seem to like it. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311674 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-20Remove "%T" from ASan Darwin tests.Kuba Mracek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311298 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-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-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-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