summaryrefslogtreecommitdiff
path: root/test/asan
AgeCommit message (Collapse)Author
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-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-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-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-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-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-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-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-07Revert r307342, r307343.Evgeniy Stepanov
Revert "Copy arguments passed by value into explicit allocas for ASan." Revert "[asan] Add end-to-end tests for overflows of byval arguments." Build failure on lldb-x86_64-ubuntu-14.04-buildserver. Test failure on clang-cmake-aarch64-42vma and sanitizer-x86_64-linux-android. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307345 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07[asan] Add end-to-end tests for overflows of byval arguments.Evgeniy Stepanov
Included is one test for passing structs by value and one test for passing C++ objects by value. Patch by Matt Morehouse. Differential revision: https://reviews.llvm.org/D34827 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307343 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01[asan] This Android lit workaround should not be needed as bug is fixedVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306942 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01[asan] Fix test on Android i686/fuguVitaly Buka
printf from .preinit_array may crash. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306940 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30[asan] Disable test which fails on Android x86Vitaly Buka
Other Android CPUs probably pass just by luck as ulimit was not executed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306914 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30[objc] Don't require null-check and don't emit memset when result is ignored ↵Kuba Mracek
for struct-returning method calls [compiler-rt part] This fixes an issue with the emission of lifetime markers for struct-returning Obj-C msgSend calls. When the result of a struct-returning call is ignored, the temporary storage is only marked with lifetime markers in one of the two branches of the nil-receiver-check. The check is, however, not required when the result is unused. If we still need to emit the check (due to consumer arguments), let's not emit the memset to zero out the result if it's unused. This fixes a use-after-scope false positive with AddressSanitizer. Differential Revision: https://reviews.llvm.org/D34834 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306838 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29Revert "[asan] Control location of symbolizer on device using ↵Vitaly Buka
ANDROID_SYMBOLIZER_PATH" Not needed, I am going to put symbolizer into tests dir. This reverts commit r306627. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306630 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29[asan] Control location of symbolizer on device using ANDROID_SYMBOLIZER_PATHVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306627 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29[asan] Fix try to fix test on AndroidVitaly Buka
%T is dir on host system, device does not have it git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306621 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29[asan] Disable tests which do no work on AndroidVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306620 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29[asan] This test now passesVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306619 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28[Sanitizers] Operator new() interceptors always die on allocation errorAlex Shlyapnikov
Summary: Operator new interceptors behavior is now controlled by their nothrow property as well as by allocator_may_return_null flag value: - allocator_may_return_null=* + new() - die on allocation error - allocator_may_return_null=0 + new(nothrow) - die on allocation error - allocator_may_return_null=1 + new(nothrow) - return null Ideally new() should throw std::bad_alloc exception, but that is not trivial to achieve, hence TODO. Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D34731 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306604 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28Revert r306504: Re-enable wait.cc, wait4.cc, waitid.cc tests on Darwin.Kuba Mracek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306551 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28Re-enable wait.cc, wait4.cc, waitid.cc tests on Darwin. They used to be ↵Kuba Mracek
flaky, something to do with LeakSanitizer now being enabled on Darwin. Let's re-enable them and see if they are still flaky or not. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306504 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-26[asan] Flag 'asan_gen_prefixes.cc' as unsupported on iOS. The ARM and ARM64 ↵Kuba Mracek
assemblers can use different label prefixes than the expected. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306335 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-24[asan] Regression test for PR33372Vitaly Buka
Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D34315 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306195 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-21Revert "[compiler-rt] Don't reset non-default user handler if ↵Vitaly Buka
allow_user_segv_handler is true." Summary: On Android we still need to reset preinstalled handlers and allow use handlers later. This reverts commit r304039. Reviewers: eugenis Subscribers: kubamracek, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D34434 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305871 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-21[asan] Fix android compiler wrapper lost in r301617.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-20[ASan] Disable allocator_oom_test.cc on s390Alex Shlyapnikov
Summary: ASan shadow memory on s390 is larger than other configurations, let's disable this test for now (will revisit it later). Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D34414 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305822 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-16[Sanitizers] Fix allocator OOM test on Windows.Alex Shlyapnikov
Summary: Point of failure is different after D34243, hence the change of the message. Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D34292 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305580 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-16[Sanitizers] Secondary allocator respects allocator_may_return_null=1.Alex Shlyapnikov
Summary: Context: https://github.com/google/sanitizers/issues/740. Making secondary allocator to respect allocator_may_return_null=1 flag and return nullptr when "out of memory" happens. More changes in primary allocator and operator new will follow. Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D34243 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305569 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15[asan] Return allow_user_segv_handler=0 to fix compatibility issues.Vitaly Buka
Summary: After r303941 it was not possible to setup ASAN_OPTIONS to have the same behavior for pre r303941 and post r303941 builds. Pre r303941 Asan does not accept handle_sigbus=2. Post r303941 Asan does not accept allow_user_segv_handler. This fix ignores allow_user_segv_handler=1, but for allow_user_segv_handler=0 it will upgrade flags like handle_sigbus=1 to handle_sigbus=2. So user can set ASAN_OPTIONS=allow_user_segv_handler=0 and have same behavior on old and new clang builds (except range from r303941 to this revision). In future users which need to prevent third party handlers should switch to handle_sigbus=2 and remove allow_user_segv_handler as soon as suport of older builds is not needed. Related bugs: https://github.com/google/oss-fuzz/issues/675 https://bugs.chromium.org/p/chromium/issues/detail?id=731130 Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D34227 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305433 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09[asan] Fix ASan internal failure in AllocateFromLocalPoolMaxim Ostapenko
This patch addresses PR 33206. There might be a situation when dynamic ASan runtime initializes later than shared library which has malloc in static constructor (rtld doesn't provide an order of shared libs initialization). In this case ASan hasn't yet initialized interceptors, but already intercepts malloc. If malloc is too big to be handled by static local pool, ASan will die with error: Sanitizer CHECK failed: lib/asan/asan_malloc_linux.cc:40 ((allocated_for_dlsym)) < ((kDlsymAllocPoolSize)) (1036, 1024) Patch by Denis Khalikov. Differential Revision: https://reviews.llvm.org/D33784 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305058 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05[ASan] A speculative attempt to fix a flaky test on ppc64be.Alex Shlyapnikov
Summary: As mentioned in test/msan/fork.cc, if test output is redirected to a file (as opposed to being piped directly to FileCheck), we may lose some "done"s due to a kernel bug: https://lkml.org/lkml/2014/2/17/324, so let's pipe the output of the test. Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D33915 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304744 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05[asan] Use asan exitcode=0 option to always succeed a test run.Alex Shlyapnikov
Summary: halt_on_error-torture.cc intermittently fails on ppc64be, let's try to collect more info on failures. Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D33912 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304731 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-04Mark the atos-symbolizer test as unsupported on i386-darwinVedant Kumar
atos is apparently not able to resolve symbol addresses properly on i386-darwin reliably any more. This is causing bot flakiness: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/6841 There have not been any SDK changes on the bot as of late. /Users/buildslave/jenkins/sharedspace/clang-stage1-cmake-RA_workspace/llvm/projects/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer.cc:20:12: error: expected string not found in input // CHECK: #1 0x{{.*}} in main {{.*}}atos-symbolizer.cc:[[@LINE-4]] ^ <stdin>:35:27: note: scanning from here #0 0x112f56 in wrap_free (/Users/buildslave/jenkins/sharedspace/clang-stage1-cmake-RA_workspace/clang-build/lib/clang/5.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib:i386+0x56f56) ^ <stdin>:35:27: note: with expression "@LINE-4" equal to "16" #0 0x112f56 in wrap_free (/Users/buildslave/jenkins/sharedspace/clang-stage1-cmake-RA_workspace/clang-build/lib/clang/5.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib:i386+0x56f56) ^ <stdin>:36:168: note: possible intended match here #1 0xb6f20 in main (/Users/buildslave/jenkins/sharedspace/clang-stage1-cmake-RA_workspace/clang-build/tools/clang/runtime/compiler-rt-bins/test/asan/I386DarwinConfig/TestCases/Darwin/Output/atos-symbolizer.cc.tmp:i386+0x1f20) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304674 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02[asan] fix one more case where stack-use-after-return is not ↵Kostya Serebryany
async-signal-safe (during thread startup). beef-up the test to give it a chance to catch regressions. Also relax the lint to make C++11 more usable. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304598 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02[sanitizer-coverage] nuke more stale codeKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304508 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01[sanitizer-coverage] nuke more stale codeKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304500 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01[asan] Add strndup/__strndup interceptors.Pierre Gousseau
Recommit of r302781 with Vitaly Buka's fix for non zero terminated strings. Differential Revision: https://reviews.llvm.org/D31457 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304399 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31[sanitizer-coverage] remove stale code (old coverage); compiler-rt part Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304318 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26[asan] Enable back halt_on_error-torture.cc disabled on PowerPC.Alex Shlyapnikov
Summary: D33521 addressed a memory ordering issue in BlockingMutex, which seems to be the cause of a flakiness of a few ASan tests on PowerPC. Reviewers: eugenis Subscribers: kubamracek, nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D33611 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304045 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26[compiler-rt] Don't reset non-default user handler if ↵Vitaly Buka
allow_user_segv_handler is true. Reviewers: eugenis, kcc Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D32457 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304039 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26[asan] Enable back some ASan tests disabled on PowerPC.Alex Shlyapnikov
Summary: D33521 addressed a memory ordering issue in BlockingMutex, which seems to be the cause of a flakiness of a few ASan tests on PowerPC. Reviewers: eugenis Subscribers: kubamracek, nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D33569 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303995 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25[compiler-rt] Replace allow_user_segv_handler=0 with kHandleSignalExclusiveVitaly Buka
Summary: allow_user_segv_handler had confusing name did not allow to control behavior for signals separately. Reviewers: eugenis, alekseyshl, kcc Subscribers: llvm-commits, dberris, kubamracek Differential Revision: https://reviews.llvm.org/D33371 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303941 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25[asan] relax sanbox_read_proc_self_maps_test to pass even if unshare() fails.Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25Disable two more flaky ASan wait* tests temporarily on DarwinAdam Nemet
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303885 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25[powerpc] deactivate flakey test halt_on_error-torture.cc on powerpc64 beBill Seurer
This test case occassionally fails when run on powerpc64 be. asan/TestCases/Posix/halt_on_error-torture.cc The failure causes false problem reports to be sent to developers whose code had nothing to do with the failures. Reactivate it when the real problem is fixed. This could also be related to the same problems as with the tests ThreadedOneSizeMallocStressTest, ThreadedMallocStressTest, ManyThreadsTest, and several others that do not run reliably on powerpc. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-23Disable flaky ASan tests temporarily on darwinAdam Nemet
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303662 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-19[compiler-rt] Switch handle_<signal> flags from bool to enum.Vitaly Buka
Summary: We are going to make it tri-state and remove allow_user_segv_handler. Reviewers: eugenis, alekseys, kcc Subscribers: kubamracek, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D33159 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303464 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-18Revert r302781 and subsequent attempts to disable part of it.Daniel Jasper
The Msan unit tests are still broken and by this point, I think we should start over. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303339 91177308-0d34-0410-b5e6-96231b3b80d8