summaryrefslogtreecommitdiff
path: root/lib/asan/tests/asan_test.cc
AgeCommit message (Collapse)Author
2017-08-07Fix asan_test.cc build on NetBSDKamil Rytarowski
Summary: Include <stdarg.h> for variable argument list macros (va_list, va_start etc). Add fallback definition of _LIBCPP_GET_C_LOCALE, this is required for GNU libstdc++ compatibility. Define new macro SANITIZER_GET_C_LOCALE. This value is currently required for FreeBSD and NetBSD for printf_l(3) tests. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, vitalybuka, filcab, fjricci Reviewed By: vitalybuka Subscribers: llvm-commits, emaste, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36406 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310323 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-18[asan] Remove recent asan tests which expect death in allocatorVitaly Buka
These tests assume allocator_may_return_null=false If allocator_may_return_null=true, gtest would not be able to switch it. Tests needs to be re-implemented as lit tests. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308254 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-05-25[compiler-rt] Change default of allow_user_segv_handler to trueVitaly Buka
Reviewers: eugenis Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D32443 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-24Revert "[compiler-rt] Change default of allow_user_segv_handler to true"Vitaly Buka
Breaks sanitizer-x86_64-linux-fuzzer bot. This reverts commit r303729. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303795 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-24[compiler-rt] Change default of allow_user_segv_handler to trueVitaly Buka
Reviewers: eugenis Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D32443 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303729 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-20Revert "[compiler-rt] Change default of allow_user_segv_handler to true"Vitaly Buka
Failed libFuzzer tests on Windows. This reverts commit r303476. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303481 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-20[compiler-rt] Change default of allow_user_segv_handler to trueVitaly Buka
Reviewers: eugenis Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D32443 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303476 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11Reapply "Enable LSan for arm Linux"Maxim Ostapenko
This patch reapplies r299923 with typo fixed in BLX macros. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299948 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11Revert r299923, it doesn't build in bootstrap builds.Nico Weber
FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.arm.dir/sanitizer_linux.cc.o lib/sanitizer_common/sanitizer_linux.cc:1340:24: error: invalid instruction BLX(ip) ^ lib/sanitizer_common/sanitizer_linux.cc:1313:19: note: expanded from macro 'BLX' # define BLX(R) "mov lr, pc; bx" #R "\n" ^ <inline asm>:6:13: note: instantiated into assembly here mov lr, pc; bxip ^~~~ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299943 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11[lsan] Enable LSan for arm LinuxMaxim Ostapenko
This patch enables LSan for arm Linux. Differential Revision: https://reviews.llvm.org/D29586 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299923 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27[powerpc] deactivate ManyThreadsTest asan test on powerpc64Bill Seurer
This test case occassionally hangs when run on powerpc. This is also a problem on AArch64 (see https://bugs.llvm.org/show_bug.cgi?id=24389). Reactivate this when the problem is fixed. This could also be related to the same problem as with the tests ThreadedOneSizeMallocStressTest, ThreadedMallocStressTest, and several others that do not run reliably on powerpc. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@298873 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-14Some ASan bots (AArch64 at least) use SEGV for a unit test error instead of ↵Filipe Cabecinhas
SIGBUS git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@297728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13[asan] Split SIGSEGV / SIGBUS handling so we can handle only one of them and ↵Filipe Cabecinhas
not the other. Summary: This is useful in some platforms where one of these signals is special. Reviewers: kubamracek, kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D30783 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@297665 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17[tests] Use __SSE2__ (rather than __i686__...) for SSE2 ASAN testMichal Gorny
Use the __SSE2__ to determine whether SSE2 is enabled in the ASAN tests rather than relying on either of the __i686__ and __x86_64__. The former is only set with explicit -march=i686, and therefore misses most of the x86 CPUs that support SSE2. __SSE2__ is in turn defined if the current settings (-march, -msse2) indicate that SSE2 is supported which should be more reliable. Differential Revision: https://reviews.llvm.org/D26763 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@287245 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-12[compiler-rt] Disable a test failing on windows.Etienne Bergeron
Summary: The unittest is not working on windows. The "regexp.h" is not available and gtest-port won't support regexp with operator '|'. The test wasn't failing on 32-bits because of this check: ``` if (SANITIZER_WORDSIZE != 64 || ASAN_AVOID_EXPENSIVE_TESTS) return; ``` ``` [ RUN ] AddressSanitizer.HugeMallocTest C:/src/llvm/llvm/utils/unittest/googletest\src/gtest-port.cc(272): error: Failed Syntax error at index 30 in simple regular expression "is located 1 bytes to the left|AddressSanitizer failed to allocate": '|' is unsupported. C:/src/llvm/llvm/projects/compiler-rt/lib/asan/tests/asan_test.cc(308): error: Death test: Ident((char*)malloc(n_megs << 20))[-1] = 0 Result: died but not with expected error. Expected: is located 1 bytes to the left|AddressSanitizer failed to allocate ``` See gtest-port.h: ``` #elif GTEST_OS_WINDOWS // <regex.h> is not available on Windows. Use our own simple regex // implementation instead. # define GTEST_USES_SIMPLE_RE 1 ``` Reviewers: rnk Subscribers: llvm-commits, wang0109, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D22257 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275181 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-30[ASan] Add shadow offset for SystemZ.Marcin Koscielnicki
This is the compiler-rt counterpart to D19650. Differential Revision: http://reviews.llvm.org/D19652 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268162 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28[ASan] Reenable __builtin_setjmp test on PowerPC, disable on SystemZ.Marcin Koscielnicki
Since __builtin_setjmp has been fixed by rL267943, the test now works on PowerPC. Enable it. On the other hand, the SystemZ backend doesn't currently support __builtin_setjmp. Disable it. Differential Revision: http://reviews.llvm.org/D19657 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267946 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-15[ASan] Make sure unittest works if sized-delete is enabled by default.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-24[tests] Resolve old TODOs in ASan unit tests.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261713 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04[ASan] Fix the links to bugs and wikipages.Alexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254735 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07[ASAN] Disable ManyThreadsTest in AArch64Renato Golin
This test was in an infinite loop in AArch64. We're investigating it on PR24389, but I'm disabling it for now, so that we continue testing everything else. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@244316 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06[sanitizer] 2-nd attempt. Add the flag handle_sigfpe that is default true to ↵Kostya Serebryany
handle SIGFPE crashes same as SIGSEV crashes, patch by Karl Skomski. This time the test is enabled only on x86-64 (it broke on ARM) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@244234 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06Revert "[sanitizer] Add the flag handle_sigfpe that is default true to ↵Renato Golin
handle SIGFPE crashes same as SIGSEV crashes, patch by Karl Skomski" This reverts commit r244136, it was breaking the ARM bots for too long. We should investigate it offline. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@244210 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-05[sanitizer] Add the flag handle_sigfpe that is default true to handle SIGFPE ↵Kostya Serebryany
crashes same as SIGSEV crashes, patch by Karl Skomski git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@244136 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-09[Compiler-rt][MIPS] Fix for asan test suite build on mips64/mips64elMohit K. Bhakkad
Patch by Sagar Thakur Reviewers: dsanders git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@234468 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-05Move use of __builtin_longjmp under the same conditions as the onlyJoerg Sonnenberger
caller of the function. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@231402 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04[Sanitizer] Fix/suppress compiler warnings in unit tests.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@231293 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03Enabling testing ASAN on AArch64Renato Golin
Also, disabling BuiltinLongJmpTest, as it fails for ARM and PPC as well. Patch by Christophe Lyon. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227966 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-22[Sanitizers] Intercept snprintf_l() on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D6418 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224700 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-12delete => delete[] for arrays.Richard Trieu
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221769 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-20Fix checks for Android.Dan Albert
__ANDROID__ is a define that comes from the toolchain when building for Android targets. ANDROID has a different meaning. ANDROID is defined for _every_ Android build, including those done for host modules. For host modules, we want to build the regular Linux sanitizers and builtins, not the one for Android devices. This hasn't been a problem until now because we only just started building the sanitizers for the host. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220203 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14Fix silly commit to disable test on ARMRenato Golin
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219681 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14Disable failing ASAN LongJump test on ARMRenato Golin
Updated the URL to reflect information on the problem as well as build the case for ARM. This seems to be a wider problem, not ARM or PPC specific. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219680 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-14Exclude Android from the tests for valloc/pvalloc.Dan Albert
These functions are being removed from Android because they were removed from POSIX 2004. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@210962 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-22[asan] relax the test for long doubleKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209445 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-12[ASan tests] Exclude/simplify a bunch of tests to make them build on WindowsTimur Iskhodzhanov
(This also requires D3720, D3725 and a few more small changes to land) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208573 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-08[ASan tests] Fix non-Windows breakageTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208332 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-08[ASan tests] More progress towards Windows supportTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208326 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18[asan] Reenable tests that should pass since PR19207 is fixed.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@206593 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-24[asan] Disable setjmp/sigsetjmp tests.Evgeniy Stepanov
Failing due to PR19207. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204590 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-24[asan] Fix a comment.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204589 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-07[ASan] Better way to disable tests for functions unavailable on certain ↵Alexey Samsonov
platforms git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203224 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19[asan] Disable asm instrumentation and tests on Mac.Evgeniy Stepanov
Move asm tests to their own file. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201653 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19[asan] Added assembly functions for x86/amd64 asan.Evgeniy Stepanov
These are runtime support functions for inline assembly instrumentation. This is a re-submit of r201402. Patch by Yuri Gorshenin. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201650 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14[asan] Revert r201402, r201404.Evgeniy Stepanov
Test fails in bootstrap build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201411 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14[asan] Added assembly functions for x86/amd64 asan.Evgeniy Stepanov
These are runtime support functions for inline assembly instrumentation. Patch by Yuri Gorshenin. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201402 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-10[asan] relax HugeMallocTest so that it does not fail on small-RAM machinesKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@196904 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-10[asan] remove one test from SizedStackTest which relied on a now-wrong ↵Kostya Serebryany
assumption that the left stack redzone is >= 32 bytes (PR18195) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@196900 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-06[asan] in SizedStackTest check the death string, also restrict one of the ↵Kostya Serebryany
checks to 64-bit git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@196576 91177308-0d34-0410-b5e6-96231b3b80d8