summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/tests/asan_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* compiler-rt: Rename .cc file in lib/asan/tests to .cppNico Weber2019-08-011-1362/+0
| | | | | | Like r367463, but for asan/tests llvm-svn: 367559
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Disable BufferOverflowAfterManyFrees for NetBSDKamil Rytarowski2018-10-301-0/+2
| | | | | | This test hangs in the i386 mode. llvm-svn: 345666
* Fix Asan-i386-calls-Test AddressSanitizer.ShadowGapTest on FreeBSDFangrui Song2018-07-281-1/+1
| | | | | | | | | 0x22000000 happens to be on the left of a heap allocation and the error message is different (heap-buffer-overflow). FreeBSD NetBSD have larger SHADOW_OFFSET (0x40000000) but let's try not using #ifdef here. llvm-svn: 338208
* [Sanitizers, test] Fix sanitizer tests on Solaris (PR 33274)Kamil Rytarowski2018-01-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch (on top of the previous two (https://reviews.llvm.org/D40898 and https://reviews.llvm.org/D40899) complete the compiler-rt side of the the Solaris sanitizer port. It contains the following sets of changes: * For the time being, the port is for 32-bit x86 only, so reject the various tests on x86_64. * When compiling as C++, <setjmp.h> resp. <iso/setjmp_iso.h> only declares _setjmp and _longjmp inside namespace std. * MAP_FILE is a Windows feature. While e.g. Linux <sys/mman.h> provides a no-op compat define, Solaris does not. * test/asan/TestCases/Posix/coverage.cc was initially failing like this: /vol/gcc/src/llvm/llvm/local/projects/compiler-rt/lib/sanitizer_common/scripts/sancov.py: 4 files merged; 2 PCs total rm: cannot remove '/var/gcc/llvm/local/projects/compiler-rt/test/asan/I386SunOSConfig/TestCases/Posix/Output/coverage': Invalid argument Further digging revealed that the rm was trying to remove the running test's working directory which failed as observed. cd'ing out of the dir before let the test pass. * Two tests needed a declaration of alloca. I've now copied the existing code from test/asan/TestCases/alloca_constant_size.cc, but it may be more profitable and maintainable to have a common testsuite header where such code is collected. * Similarly, Solaris' printf %p format doesn't include the leading 0x. * In test/asan/TestCases/malloc-no-intercept.c, I had to undef __EXTENSIONS__ (predefined by clang for no apparent reason) to avoid conflicting declarations for memalign. * test/ubsan/TestCases/Float/cast-overflow.cpp has different platform dependent ways to define BYTE_ORDER and friends. Why not just use __BYTE_ORDER__ and friends as predefined by clang and gcc? Patch by Rainer Orth. Reviewers: kcc, alekseyshl Reviewed By: alekseyshl Subscribers: srhines, kubamracek, mgorny, krytarowski, fedor.sergeev, JDevlieghere, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40900 llvm-svn: 322635
* Fix asan_test.cc build on NetBSDKamil Rytarowski2017-08-071-10/+20
| | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 310323
* [asan] Remove recent asan tests which expect death in allocatorVitaly Buka2017-07-181-10/+0
| | | | | | | | 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. llvm-svn: 308254
* [Sanitizers] ASan and LSan allocator set errno on failure.Alex Shlyapnikov2017-07-141-2/+16
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 308064
* [compiler-rt] Change default of allow_user_segv_handler to trueVitaly Buka2017-05-251-8/+13
| | | | | | | | | | Reviewers: eugenis Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D32443 llvm-svn: 303842
* Revert "[compiler-rt] Change default of allow_user_segv_handler to true"Vitaly Buka2017-05-241-13/+8
| | | | | | | | Breaks sanitizer-x86_64-linux-fuzzer bot. This reverts commit r303729. llvm-svn: 303795
* [compiler-rt] Change default of allow_user_segv_handler to trueVitaly Buka2017-05-241-8/+13
| | | | | | | | | | Reviewers: eugenis Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D32443 llvm-svn: 303729
* Revert "[compiler-rt] Change default of allow_user_segv_handler to true"Vitaly Buka2017-05-201-13/+8
| | | | | | | | Failed libFuzzer tests on Windows. This reverts commit r303476. llvm-svn: 303481
* [compiler-rt] Change default of allow_user_segv_handler to trueVitaly Buka2017-05-201-8/+13
| | | | | | | | | | Reviewers: eugenis Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D32443 llvm-svn: 303476
* Reapply "Enable LSan for arm Linux"Maxim Ostapenko2017-04-111-0/+8
| | | | | | This patch reapplies r299923 with typo fixed in BLX macros. llvm-svn: 299948
* Revert r299923, it doesn't build in bootstrap builds.Nico Weber2017-04-111-8/+0
| | | | | | | | | | | | | | | 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 ^~~~ llvm-svn: 299943
* [lsan] Enable LSan for arm LinuxMaxim Ostapenko2017-04-111-0/+8
| | | | | | | | This patch enables LSan for arm Linux. Differential Revision: https://reviews.llvm.org/D29586 llvm-svn: 299923
* [powerpc] deactivate ManyThreadsTest asan test on powerpc64Bill Seurer2017-03-271-1/+2
| | | | | | | | | | | | 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. llvm-svn: 298873
* Some ASan bots (AArch64 at least) use SEGV for a unit test error instead of ↵Filipe Cabecinhas2017-03-141-1/+1
| | | | | | SIGBUS llvm-svn: 297728
* [asan] Split SIGSEGV / SIGBUS handling so we can handle only one of them and ↵Filipe Cabecinhas2017-03-131-1/+1
| | | | | | | | | | | | | | 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 llvm-svn: 297665
* [tests] Use __SSE2__ (rather than __i686__...) for SSE2 ASAN testMichal Gorny2016-11-171-1/+1
| | | | | | | | | | | | | 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 llvm-svn: 287245
* [compiler-rt] Disable a test failing on windows.Etienne Bergeron2016-07-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 275181
* [ASan] Add shadow offset for SystemZ.Marcin Koscielnicki2016-04-301-0/+2
| | | | | | | | This is the compiler-rt counterpart to D19650. Differential Revision: http://reviews.llvm.org/D19652 llvm-svn: 268162
* [ASan] Reenable __builtin_setjmp test on PowerPC, disable on SystemZ.Marcin Koscielnicki2016-04-281-6/+5
| | | | | | | | | | | | 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 llvm-svn: 267946
* [ASan] Make sure unittest works if sized-delete is enabled by default.Alexey Samsonov2016-03-151-4/+10
| | | | llvm-svn: 263575
* [tests] Resolve old TODOs in ASan unit tests.Alexey Samsonov2016-02-241-3/+0
| | | | llvm-svn: 261713
* [ASan] Fix the links to bugs and wikipages.Alexander Potapenko2015-12-041-4/+4
| | | | llvm-svn: 254735
* [ASAN] Disable ManyThreadsTest in AArch64Renato Golin2015-08-071-0/+3
| | | | | | | | 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. llvm-svn: 244316
* [sanitizer] 2-nd attempt. Add the flag handle_sigfpe that is default true to ↵Kostya Serebryany2015-08-061-4/+4
| | | | | | 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) llvm-svn: 244234
* Revert "[sanitizer] Add the flag handle_sigfpe that is default true to ↵Renato Golin2015-08-061-16/+4
| | | | | | | | 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. llvm-svn: 244210
* [sanitizer] Add the flag handle_sigfpe that is default true to handle SIGFPE ↵Kostya Serebryany2015-08-051-4/+16
| | | | | | crashes same as SIGSEV crashes, patch by Karl Skomski llvm-svn: 244136
* [Compiler-rt][MIPS] Fix for asan test suite build on mips64/mips64elMohit K. Bhakkad2015-04-091-2/+4
| | | | | | | Patch by Sagar Thakur Reviewers: dsanders llvm-svn: 234468
* Move use of __builtin_longjmp under the same conditions as the onlyJoerg Sonnenberger2015-03-051-9/+9
| | | | | | caller of the function. llvm-svn: 231402
* [Sanitizer] Fix/suppress compiler warnings in unit tests.Alexey Samsonov2015-03-041-5/+5
| | | | llvm-svn: 231293
* Enabling testing ASAN on AArch64Renato Golin2015-02-031-1/+2
| | | | | | | | Also, disabling BuiltinLongJmpTest, as it fails for ARM and PPC as well. Patch by Christophe Lyon. llvm-svn: 227966
* [Sanitizers] Intercept snprintf_l() on FreeBSDViktor Kutuzov2014-12-221-0/+30
| | | | | | Differential Revision: http://reviews.llvm.org/D6418 llvm-svn: 224700
* delete => delete[] for arrays.Richard Trieu2014-11-121-1/+1
| | | | llvm-svn: 221769
* Fix checks for Android.Dan Albert2014-10-201-4/+4
| | | | | | | | | | | | __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. llvm-svn: 220203
* Fix silly commit to disable test on ARMRenato Golin2014-10-141-1/+1
| | | | llvm-svn: 219681
* Disable failing ASAN LongJump test on ARMRenato Golin2014-10-141-3/+3
| | | | | | | 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. llvm-svn: 219680
* Exclude Android from the tests for valloc/pvalloc.Dan Albert2014-06-141-1/+2
| | | | | | | These functions are being removed from Android because they were removed from POSIX 2004. llvm-svn: 210962
* [asan] relax the test for long doubleKostya Serebryany2014-05-221-2/+2
| | | | llvm-svn: 209445
* [ASan tests] Exclude/simplify a bunch of tests to make them build on WindowsTimur Iskhodzhanov2014-05-121-10/+45
| | | | | | (This also requires D3720, D3725 and a few more small changes to land) llvm-svn: 208573
* [ASan tests] Fix non-Windows breakageTimur Iskhodzhanov2014-05-081-2/+5
| | | | llvm-svn: 208332
* [ASan tests] More progress towards Windows supportTimur Iskhodzhanov2014-05-081-20/+37
| | | | llvm-svn: 208326
* [asan] Reenable tests that should pass since PR19207 is fixed.Evgeniy Stepanov2014-04-181-5/+3
| | | | llvm-svn: 206593
* [asan] Disable setjmp/sigsetjmp tests.Evgeniy Stepanov2014-03-241-3/+5
| | | | | | Failing due to PR19207. llvm-svn: 204590
* [asan] Fix a comment.Evgeniy Stepanov2014-03-241-2/+3
| | | | llvm-svn: 204589
* [ASan] Better way to disable tests for functions unavailable on certain ↵Alexey Samsonov2014-03-071-29/+12
| | | | | | platforms llvm-svn: 203224
* [asan] Disable asm instrumentation and tests on Mac.Evgeniy Stepanov2014-02-191-201/+0
| | | | | | Move asm tests to their own file. llvm-svn: 201653
* [asan] Added assembly functions for x86/amd64 asan.Evgeniy Stepanov2014-02-191-0/+201
| | | | | | | | | These are runtime support functions for inline assembly instrumentation. This is a re-submit of r201402. Patch by Yuri Gorshenin. llvm-svn: 201650
OpenPOWER on IntegriCloud