summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/tests/asan_test.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* [asan] Revert r201402, r201404.Evgeniy Stepanov2014-02-141-199/+0
| | | | | | Test fails in bootstrap build. llvm-svn: 201411
* [asan] Added assembly functions for x86/amd64 asan.Evgeniy Stepanov2014-02-141-0/+199
| | | | | | | | These are runtime support functions for inline assembly instrumentation. Patch by Yuri Gorshenin. llvm-svn: 201402
* [asan] relax HugeMallocTest so that it does not fail on small-RAM machinesKostya Serebryany2013-12-101-1/+3
| | | | llvm-svn: 196904
* [asan] remove one test from SizedStackTest which relied on a now-wrong ↵Kostya Serebryany2013-12-101-2/+0
| | | | | | assumption that the left stack redzone is >= 32 bytes (PR18195) llvm-svn: 196900
* [asan] in SizedStackTest check the death string, also restrict one of the ↵Kostya Serebryany2013-12-061-8/+9
| | | | | | checks to 64-bit llvm-svn: 196576
* [asan] require __i686__ for the SSE test; also make weaker claims about ↵Kostya Serebryany2013-12-041-5/+8
| | | | | | stack buffer overflows in another test llvm-svn: 196375
* [asan] revert 196373: committed to many files by mistakeKostya Serebryany2013-12-041-8/+5
| | | | llvm-svn: 196374
* [asan] require __i686__ for the SSE test; also make weaker claims about ↵Kostya Serebryany2013-12-041-5/+8
| | | | | | stack buffer overflows in another test llvm-svn: 196373
* [asan] disable AddressSanitizer.HugeMallocTest if ASAN_AVOID_EXPENSIVE_TESTS ↵Kostya Serebryany2013-12-021-1/+1
| | | | | | is set llvm-svn: 196097
* [asan] Remove CallocOverflow32 test from asan_test.Evgeniy Stepanov2013-10-161-11/+0
| | | | | | | The same as with MSan, this test behavior depends on ASAN_OPTIONS, and we've got a lit_test that covers this. llvm-svn: 192777
* [ASan] Split ASan unit tests into two different binaries:Alexey Samsonov2013-09-161-0/+29
| | | | | | | (1) instrumented, i.e. compiled and linked with -fsanitize=address (2) not instrumented, compiled w/o -fsanitize=address and linked with ASan runtime statically. llvm-svn: 190788
* Migrate ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS to new spelling - ↵Alexey Samsonov2013-09-061-4/+4
| | | | | | ATTRIBUTE_NO_SANITIZE_ADDRESS llvm-svn: 190136
* [sanitizer] make the allocator crash instead of returning 0 on huge size ↵Kostya Serebryany2013-09-061-20/+0
| | | | | | (controlled by the allocator_may_return_null flag) llvm-svn: 190127
* [ASan] Fix leaks in ASan tests found by LSanAlexey Samsonov2013-07-181-0/+2
| | | | llvm-svn: 186577
* [ASan] make pthread_getschedparam test more robustAlexey Samsonov2013-06-061-2/+2
| | | | llvm-svn: 183411
* Call __asan_free_hook() before marking the chunk quarantinnedAlexey Samsonov2013-06-041-4/+14
| | | | | | | | | | | | | | | | | | | | | Summary: With this change, the user may safely call __asan_get_ownership() from malloc/free hooks and assume it would return "true". If there is a realloc/free race, free hook might be called twice, but I think it's acceptable, as it's a data race and would later be reported anyway. This change also fixes a bug when failing realloc incorrectly marked the original memory as "quarantinned". Reviewers: timurrrr, kcc, samsonov Reviewed By: samsonov CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D913 llvm-svn: 183220
* [asan] workaround for asan bug 189 (swapcontext followed by throw gets OOM ↵Kostya Serebryany2013-05-221-4/+6
| | | | | | kill). Also, disable swapcontext_test on non-x86. Fix lint llvm-svn: 182456
* [sanitizer] Intercept pthread_getschedparam.Evgeniy Stepanov2013-05-211-0/+11
| | | | llvm-svn: 182353
* Fix realloc'ing freed/invalid pointersTimur Iskhodzhanov2013-05-201-0/+12
| | | | | | See https://code.google.com/p/address-sanitizer/issues/detail?id=187 for the details llvm-svn: 182255
* [asan] fix ShadowGapTest on PowerPC64Kostya Serebryany2013-05-161-0/+4
| | | | llvm-svn: 181991
* [asan] disable BuiltinLongJmpTest on PowerPCKostya Serebryany2013-05-151-1/+4
| | | | llvm-svn: 181890
* [asan] fix powerpc build and one test; fix lintKostya Serebryany2013-05-151-2/+2
| | | | llvm-svn: 181881
* [ASan] Disable AddressSanitizer.AllocDeallocMismatch on Darwin.Alexander Potapenko2013-04-231-1/+3
| | | | | | See https://code.google.com/p/address-sanitizer/issues/detail?id=131. llvm-svn: 180093
* [asan] Change the way we report the alloca frame on stack-buff-overflow.Kostya Serebryany2013-03-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: the function name was stored by the compiler as a constant string and the run-time was printing it. Now: the PC is stored instead and the run-time prints the full symbolized frame. This adds a couple of instructions into every function with non-empty stack frame, but also reduces the binary size because we store less strings (I saw 2% size reduction). This change bumps the asan ABI version to v3. compiler-rt part, llvm part will follow. Example of report (now): ==31711==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffa77cf1c5 at pc 0x41feb0 bp 0x7fffa77cefb0 sp 0x7fffa77cefa8 READ of size 1 at 0x7fffa77cf1c5 thread T0 #0 0x41feaf in Frame0(int, char*, char*, char*) stack-oob-frames.cc:20 #1 0x41f7ff in Frame1(int, char*, char*) stack-oob-frames.cc:24 #2 0x41f477 in Frame2(int, char*) stack-oob-frames.cc:28 #3 0x41f194 in Frame3(int) stack-oob-frames.cc:32 #4 0x41eee0 in main stack-oob-frames.cc:38 #5 0x7f0c5566f76c (/lib/x86_64-linux-gnu/libc.so.6+0x2176c) #6 0x41eb1c (/usr/local/google/kcc/llvm_cmake/a.out+0x41eb1c) Address 0x7fffa77cf1c5 is located in stack of thread T0 at offset 293 in frame #0 0x41f87f in Frame0(int, char*, char*, char*) stack-oob-frames.cc:12 <<<<<<<<<<<<<< this is new This frame has 6 object(s): [32, 36) 'frame.addr' [96, 104) 'a.addr' [160, 168) 'b.addr' [224, 232) 'c.addr' [288, 292) 's' [352, 360) 'd' llvm-svn: 177723
* [ASan] Fix an error on invalid deallocation in ASan allocator. When ASan ↵Alexey Samsonov2013-03-221-2/+4
| | | | | | checks if memory freed by user was indeed previously allocated, it first does an atomic write to presumed location of chunk header. This is wrong, as if the free is invalid, we may overwrite some valuable data (like other fields of the chunk header). Fix this by using atomic_compare_exchange instead. llvm-svn: 177710
* [asan] Switch to allocator2 on Android.Evgeniy Stepanov2013-03-181-1/+2
| | | | llvm-svn: 177263
* [asan] remove one redundant malloc stress test, unify the usage of ↵Kostya Serebryany2013-03-141-60/+2
| | | | | | ASAN_LOW_MEMORY macro in tests, slightly reduce test memory usage (all to make 32-bit runs consume less RAM) llvm-svn: 177069
* [asan] Revert r176255, r176264.Evgeniy Stepanov2013-03-011-2/+1
| | | | | | New allocator has 1.5x memory overhead of the old one. llvm-svn: 176340
* [asan] Lower memory usage in LargeMallocTest on Android.Evgeniy Stepanov2013-02-281-1/+2
| | | | llvm-svn: 176264
* [asan] fix the output for range accesses (memset, etc); improve the tests; ↵Kostya Serebryany2013-02-261-1/+2
| | | | | | more strict checking in memcmp llvm-svn: 176078
* [ASan] revert part of r175631 that looks like accidental commitAlexey Samsonov2013-02-201-5/+0
| | | | llvm-svn: 175655
* [ASan] Delete asan/dynamic dir and temporarily move the interposers ↵Alexander Potapenko2013-02-201-0/+5
| | | | | | | | declarations to asan_intercepted_functions.h Now that we have only one dependency on asan_intercepted_functions.h, we can unite that code with the interceptors declarations in asan_interceptors.cc and get rid of asan_intercepted_functions.h llvm-svn: 175631
* [asan] don't run the long double test if long double is the same as doubleKostya Serebryany2013-02-191-0/+1
| | | | llvm-svn: 175514
* [asan] instrument memory accesses with unusual sizesKostya Serebryany2013-02-191-0/+20
| | | | | | | | | | | | | | | | This patch makes asan instrument memory accesses with unusual sizes (e.g. 5 bytes or 10 bytes), e.g. long double or packed structures. Instrumentation is done with two 1-byte checks (first and last bytes) and if the error is found __asan_report_load_n(addr, real_size) or __asan_report_store_n(addr, real_size) is called. asan-rt part Also fix lint. llvm-svn: 175508
* [ASan] Enable alloc_dealloc_mismatch by default on Darwin.Alexander Potapenko2013-02-071-2/+1
| | | | | | Enable AddressSanitizer.AllocDeallocMismatch tests. llvm-svn: 174628
* [ASan] remove debug output from the testAlexey Samsonov2013-02-011-2/+0
| | | | llvm-svn: 174188
* ASan: fix lintAlexey Samsonov2013-01-291-6/+6
| | | | llvm-svn: 173795
* [ASan] Do allocate memory even for zero-size allocation requests. Explain ↵Alexey Samsonov2013-01-291-0/+20
| | | | | | why we have to do this in comments. llvm-svn: 173776
* [ASan] fix a bug in allocator-v2 which could lead to SEGV on ↵Alexey Samsonov2013-01-281-0/+9
| | | | | | realloc(malloc(0), 4) llvm-svn: 173681
* [asan] simplify the code that poisons global redzones, add some more testsKostya Serebryany2013-01-231-2/+0
| | | | llvm-svn: 173251
* [asan] split asan_test.cc even moreKostya Serebryany2013-01-221-587/+0
| | | | llvm-svn: 173131
* [asan] split asan_test.cc moreKostya Serebryany2013-01-221-224/+10
| | | | llvm-svn: 173130
* [asan] split asan_test.cc to speedup parallel build (most important if ↵Kostya Serebryany2013-01-221-164/+0
| | | | | | building with a debug clang, which takes a couple of minutes on this large file with templates). More splits to follow llvm-svn: 173129
* [asan] fix linux buildKostya Serebryany2013-01-211-9/+9
| | | | llvm-svn: 173049
* [ASan] Move Mac-specific tests to asan_mac_test.ccAlexander Potapenko2013-01-211-231/+10
| | | | llvm-svn: 173048
* [ASan] fixes for Android buildAlexey Samsonov2013-01-181-2/+2
| | | | llvm-svn: 172800
* [sanitizer] reapply r172719, r172721-172723, r172725, and also fix the ↵Kostya Serebryany2013-01-181-30/+16
| | | | | | warning on Mac. llvm-svn: 172791
* Revert r172719, r172721-172723, and r172725.Jakob Stoklund Olesen2013-01-171-16/+30
| | | | | | | | | | | | | | | | | | The r172719 patch broke the build on Mac, the others depended on it. compiler-rt/lib/asan/asan_interceptors.cc:78:13: error: unused function 'SetThreadName' [-Werror,-Wunused-function] static void SetThreadName(const char *name) { Orignal headlines: [asan] attempting to fix the Mac build [asan] restructure read/pread/pread64 tests [sanitizer] move write/pwrite/pwrite64 interceptors to common [msan] start using common interceptors in msan [tsan] move prctl interceptor from asan to common_interceptors thus enabling it for tsan too llvm-svn: 172763
* [asan] restructure read/pread/pread64 testsKostya Serebryany2013-01-171-30/+16
| | | | llvm-svn: 172723
* Move large part of asan_test_utils.h to sanitizer_common.Evgeniy Stepanov2013-01-141-13/+5
| | | | | | | | | Move my_rand() to the common header. This lets us avoid the use of rand_r in sanitizer_common tests. There is no rand_r on Android. llvm-svn: 172421
OpenPOWER on IntegriCloud