summaryrefslogtreecommitdiff
path: root/test/asan
AgeCommit message (Collapse)Author
2018-07-18Rename __asan_gen_* symbols to ___asan_gen_*.Peter Collingbourne
This prevents gold from printing a warning when trying to export these symbols via the asan dynamic list after ThinLTO promotes them from private symbols to external symbols with hidden visibility. Differential Revision: https://reviews.llvm.org/D49498 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337428 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-10Limit ASan non-executable-pc test case to x86 botsVlad Tsyrklevich
The test case fails on the big-endian PPC bot, probably because PowerPC uses function descriptors. More over other architectures don't support NX mappings. (This test case was not being exercised prior to r336633.) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336714 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-10[asan] Disable non-execute test on s390Ulrich Weigand
Processors before z14 don't support non-execute protection, so they will start execution random memory contents, causing the test to randomly fail or succeed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336705 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-10[compiler-rt] Get rid of "%T" expansionsFilipe Cabecinhas
Summary: Original patch by Kuba Mracek The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t. This patch removes %T in compiler-rt. Differential Revision: https://reviews.llvm.org/D48618 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336661 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-28[asan] Change 3 tests from XFAIL to UNSUPPORTED.Evgeniy Stepanov
The failure in https://github.com/google/sanitizers/issues/981 is flaky. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335941 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-28[asan] Disable 3 tests on Android O+.Evgeniy Stepanov
https://github.com/google/sanitizers/issues/981 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335937 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-28[asan] un-XFAIL one testEvgeniy Stepanov
NDK r16 provides glob.h, which makes this test pass. Supporting different test outcomes depending on the version of NDK add unnecessary complexity to the test harness. IMHO, it's OK to require the latest stable release. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335935 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-28Support for multiarch runtimes layoutPetr Hosek
This change adds a support for multiarch style runtimes layout, so in addition to the existing layout where runtimes get installed to: lib/clang/$version/lib/$os Clang now allows runtimes to be installed to: lib/clang/$version/$target/lib This also includes libc++, libc++abi and libunwind; today those are assumed to be in Clang library directory built for host, with the new layout it is possible to install libc++, libc++abi and libunwind into the runtime directory built for different targets. The use of new layout is enabled by setting the LLVM_ENABLE_RUNTIME_TARGET_DIR CMake variable and is supported by both projects and runtimes layouts. The runtimes CMake build has been further modified to use the new layout when building runtimes for multiple targets. Differential Revision: https://reviews.llvm.org/D45604 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335809 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-27[asan] Relax the null_deref.cc test even furtherVedant Kumar
On Darwin/x86_64, asan may report the crashing line of NullDeref as line 19 (i.e the closing brace of the function), whereas on other targets we see line 15 ("ptr[10]++"). The optimized debug info here isn't reliable enough to check. rdar://problem/41526369 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335747 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-27[asan] Relax a test which depends on optimized debug infoVedant Kumar
On some ARM platforms this test depends on debug locations being present on constant materialization code, which was eliminated in r335497. Relax the test to allow two outcomes: the backtrace either contains the right line numbers, or no line numbers. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335741 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-20[sanitizer] Unify and generalize Apple platforms in CMake and lit test configsKuba Mracek
There's more platforms than just "ios" and "iossim" that we should support, and adding more lit config variables for each platform isn't great. Let's generalize and have a single value that determines what the platform under test is. Differential Revision: https://reviews.llvm.org/D48309 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335123 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-20[asan] Add flushes to try to fix testReid Kleckner
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335089 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-20[asan] Add Windows test for handle_segv and SetUnhandledExceptionFilterReid Kleckner
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335087 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-16[asan] Enable fgets_fputs test on AndroidVitaly Buka
"echo data" didn't work because %run on android executes test on the device when lit shell command on the host system. https://github.com/google/sanitizers/issues/952 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334883 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-15[asan] Move long-object-path.cc test to LinuxVitaly Buka
Reviewers: Lekensteyn Reviewed By: Lekensteyn Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D48186 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334866 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-14[ASAN] fix typos and disable long-object-path test for win32Peter Wu
Glob patterns seem unsupported for commands executed by the emulated shell (LIT_USE_INTERNAL_SHELL=1). Disable the test while that is being addressed (a workaround such as "cd a-*" also does not work). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334719 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-14[ASAN] fix startup crash in dlsym for long paths since glibc 2.27Peter Wu
Summary: Error messages for dlsym used to be stored on the stack, but since commit 2449ae7b ("ld.so: Introduce struct dl_exception") in glibc 2.27 these are now stored on the heap (and thus use the dlsym alloc pool). Messages look like "undefined symbol: __isoc99_printf\0/path/to/a.out". With many missing library functions and long object paths, the pool is quickly exhausted. Implement a simple mechanism to return freed memory to the pool (clear it in case it is used for calloc). Fixes https://github.com/google/sanitizers/issues/957 Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D47995 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334703 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-13[ASAN] Re-enable fgets_fputs test for darwin.Ahmed Bougacha
It seems to be passing, at least on the bots I've seen. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334626 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12[ASAN] disable fgets_fputs test for android and darwinPeter Wu
aarch64/aosp_marlin-userdebug/OPR4.170623.016] builder unexpectedly failed the fgets test (`assertion "fp" failed`). macOS unexpectedly passes the fputs test without triggering ASAN. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334558 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12[ASAN] fix fgets and fgets_fputs tests failurePeter Wu
Some systems (Android) might not have /etc/passwd. Fixes r334450. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334487 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-11[sanitizer] Add fgets, fputs and puts into sanitizer_commonPeter Wu
Summary: Add fgets, fputs and puts to sanitizer_common. This adds ASAN coverage for these functions, extends MSAN support from fgets to fputs/puts and extends TSAN support from puts to fputs. Fixes: https://github.com/google/sanitizers/issues/952 Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D46545 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334450 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-11[Sanitizers] Move allocator_returns_null.cc test to common.Alex Shlyapnikov
Summary: Add allocator_returns_null.cc test to sanitizer_common and remove all sanitizer-specific ones except: - HWASan is not covered by sanitizer_common - TSan allocator does not have comprehensive error reporting yet Reviewers: vitalybuka Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D47971 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334433 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-11[Sanitizers] Move pvalloc overflow tests to common.Alex Shlyapnikov
Summary: Now all sanitizers with improved allocator error reporting are covered by these common tests. Also, add pvalloc-specific checks to LSan. HWASan is not covered by sanitizer_common, hence its own pvalloc and other allocator tests. Reviewers: vitalybuka Subscribers: srhines, kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D47970 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334424 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-08[asan] Re-enable no_asan_gen_globals for 32-bitVitaly Buka
PR22682. Bug in gold was fixed 3 years ago. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334319 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-08[Sanitizers] Check alignment != 0 for aligned_alloc and posix_memalignAlex Shlyapnikov
Summary: Move the corresponding tests to the common folder (as all of the sanitizer allocators will support this feature soon) and add the checks specific to aligned_alloc to ASan and LSan allocators. Reviewers: vitalybuka Subscribers: srhines, kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D47924 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334316 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-01[ASAN] Sanitize testsuite for ARM.Yvan Roux
Address failures exhibited by ARMv8 bot in Thumb mode: - Fix logic for fast unwinding support (i.e feature is not available for Thumb) - Fix Unsupported and Requires rules to handle armv8 as well as soft and hard float targets - Un-xfail passing tests Differential Revision: https://reviews.llvm.org/D47575 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@333729 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-19Do not link with -ldl in NetBSD/ASan testsKamil Rytarowski
Summary: The dlopen(3) features on NetBSD are in libc. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D46713 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332790 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14Fix another case where libstdc++ is being inappropriately requested (seeDan Liew
r328775) for all platforms. Given that this is the second occurance of this problem it seemed worth fixing this problem in a more generic way. r328775 has been reverted and now a substitution `%linux_static_libstdcplusplus` has been provided. This substitution expands to Clang driver arguments to use a static libstdc++ on Linux and on all other platforms it expands to nothing. The `asan/TestCases/throw_invoke_test.cc` and `test/tsan/static_init6.cc` test cases now use this substitution. rdar://problem/39948818 Differential Revision: https://reviews.llvm.org/D46401 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332254 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-26[asan] Align __asan_global_start so that it works with LLDReid Kleckner
Otherwise LLD will not align the .ASAN$GA section start, and &__asan_globals + 1 will not be the start of the next real ASan global metadata in .ASAN$GL. We discovered this issue when attempting to use LLD on Windows in Chromium: https://crbug.com/837090 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@330990 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-20asan: Mark printf-4.c as unsupported on Windows.Peter Collingbourne
Although sprintf is not intercepted on Windows, this test can pass if sprintf calls memmove, which is intercepted, so we can't XFAIL it. Differential Revision: https://reviews.llvm.org/D45894 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@330469 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-13[asan] Reduce flakiness in stack-overflow detectionKuba Mracek
IsStackOverflow only treats accesses within 512 bytes of SP as stack-overflow. This should really be the size of a page instead. The scariness_score_test.cc triggers stack overflow with frames that are even larger than a page, which can also trigger a fault that will not be recognized as stack-overflow. Let's just use smaller frames. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@329980 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-10[compiler-rt][asan][mips] UnXFAIL some consistently passing testsSimon Dardis
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@329688 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04[asan] Fix aligned_alloc test caseKostya Kortchinsky
Summary: Under some circumstances (that I haven't dug further into), the first stack frame for the test looks like: `#0 0x4e6038 in __interceptor_memalign.localalias.1 ...compiler-rt/lib/asan/asan_malloc_linux.cc:113` which isn't matched by the current CHECK. Expand the CHECK to match aligned_alloc or memalign. Hopefully this should fix the PowerPC issue as well, otherwise we'll bring back the FIXME. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: srhines, kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D45281 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@329226 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-30[ASan] Disable new ASan error reporting tests on various ARMs.Alex Shlyapnikov
As many other ASan tests already, has to disable these failing tests on arm, armhf and aarch64 configs. Differential Revision: https://reviews.llvm.org/D44404 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328849 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29[asan] Split the `throw_invoke_test.cc` into a Linux specific variantDan Liew
and the general version to avoid use of libstdc++ on non-Linux platforms. This is motivated by the fact that using `libstdc++` is deprecated on Darwin and maybe removed some day. Differential Revision: https://reviews.llvm.org/D44733 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328775 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29[ASan] Disable aligned_alloc-alignment.cc on PPC64.Alex Shlyapnikov
Differential Revision: https://reviews.llvm.org/D44404 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328753 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29[ASan] Disable aligned_alloc-alignment.cc on ppc64beAlex Shlyapnikov
Differential Revision: https://reviews.llvm.org/D44404 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328742 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-28[ASan] Disable aligned_alloc-alignment.cc test on gcc.Alex Shlyapnikov
This check "CHECK: {{#0 0x.* in .*aligned_alloc}}" fails on ppc64be, gcc build. Disabling the test for gcc for now. Differential Revision: https://reviews.llvm.org/D44404 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328741 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-28[ASan] Disable aligned_alloc-alignment.cc on Android.Alex Shlyapnikov
Differential Revision: https://reviews.llvm.org/D44404 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328734 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-28[ASan] Add aligned_alloc declaration to aligned_alloc-alignment.cc test.Alex Shlyapnikov
aligned_alloc is not always defined in headers. Differential Revision: https://reviews.llvm.org/D44404 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328726 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-28[ASan] Report proper ASan error on allocator failures instead of CHECK(0)-ingAlex Shlyapnikov
Summary: Currently many allocator specific errors (OOM, for example) are reported as a text message and CHECK(0) termination, not stack, no details, not too helpful nor informative. To improve the situation, ASan detailed errors were defined and reported under the appropriate conditions. Issue: https://github.com/google/sanitizers/issues/887 Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D44404 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328722 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-27Revert "[asan] Replace vfork with fork."Evgeniy Stepanov
Replacing vfork with fork results in significant slowdown of certain apps (in particular, memcached). This reverts r327752. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328600 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-16[asan] Replace vfork with fork.Evgeniy Stepanov
Summary: vfork is not ASan-friendly because it modifies stack shadow in the parent process address space. While it is possible to compensate for that with, for example, __asan_handle_no_return before each call to _exit or execve and friends, simply replacing vfork with fork looks like by far the easiest solution. Posix compliant programs can not detect the difference between vfork and fork. Fixes https://github.com/google/sanitizers/issues/925 Reviewers: kcc, vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D44587 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@327752 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-12[asan] poison_heap=0 should not disable __asan_handle_no_return.Evgeniy Stepanov
Reviewers: kcc, alekseyshl, vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D44339 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@327337 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-09[asan] Clean up the REQUIRES of `asan/TestCases/strcat-overlap.cc`Dan Liew
by explicitly listing where we expect this test to work. Because this test invokes undefined behaviour all sorts of things can happen (e.g. crash, or on some bots asan manages to catch something). The test seems to pass okay on Darwin (x86_64/x86_64/i386) and on Linux (x86_64/i386) so explicitly require one of these platforms to run the test. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@327185 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-09[asan] Try to unbreak arm build bots by only running the test onDan Liew
x86_64 and x86_64H (and not in the iOS simulator) where it seems to work. We need to properly fix the test when time permits. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@327122 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-09Mark the -overlap tests are "UNSUPPORTED: android". Android test harness ↵Kuba Mracek
doesn't know how to handle suppression files. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@327091 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-09Mark strcat-overlap.cc as "UNSUPPORTED: win32"Kuba Mracek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@327081 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08Move lto-constmerge-odr.cc to Posix (it's failing on Windows).Kuba Mracek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@327080 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08[asan] Fix bug where suppression of overlapping accesses was ignored onDan Liew
`strcpy()`, `strncpy()`, `strcat()`, and `strncat()`. rdar://problem/35576899 Differential Revision: https://reviews.llvm.org/D43702 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@327068 91177308-0d34-0410-b5e6-96231b3b80d8