summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* [asan] make calloc crash instead of returning 0 on overflow (controlled by ↵Kostya Serebryany2013-09-061-10/+5
| | | | | | the allocator_may_return_null flag) llvm-svn: 190128
* [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: Add a wcslen interceptor mirroring strlenReid Kleckner2013-09-051-0/+11
| | | | | | Tested on Linux, since I can't build the tests on Windows yet. llvm-svn: 190022
* [asan]: fix a CHECK failure in use-after-return mode; enable and fix ↵Kostya Serebryany2013-08-281-0/+9
| | | | | | stack-use-after-return.cc; add a test for UAR mode in asan_noinst_test llvm-svn: 189457
* [ASan] Fix leaks in ASan tests found by LSanAlexey Samsonov2013-07-181-0/+2
| | | | llvm-svn: 186577
* [asan] fix the bug with memalign and malloc_usable_size ↵Kostya Serebryany2013-06-101-0/+1
| | | | | | (http://code.google.com/p/address-sanitizer/issues/detail?id=193); also fix lint llvm-svn: 183647
* [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
* Quick fix for ASan test build on Android.Sergey Matveev2013-05-081-12/+11
| | | | llvm-svn: 181429
* [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] nuke the old unused allocator codeKostya Serebryany2013-04-042-93/+0
| | | | llvm-svn: 178758
* [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] make the __asan_get_heap_size more robustKostya Serebryany2013-03-181-0/+1
| | | | llvm-svn: 177270
* [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-144-75/+19
| | | | | | 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] if calloc returns a freshly-mmaped memory, don't clear it with ↵Kostya Serebryany2013-02-271-0/+18
| | | | | | memset. Speeds up calloc-intensive code llvm-svn: 176185
* [asan] fix the output for range accesses (memset, etc); improve the tests; ↵Kostya Serebryany2013-02-262-1/+9
| | | | | | more strict checking in memcmp llvm-svn: 176078
* [asan] speedup by more than 2x handling of the small memset/memcpy/etc callsKostya Serebryany2013-02-211-1/+10
| | | | llvm-svn: 175728
* [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] use short path for sanitizer_common/tests/sanitizer_test_utils.h, add ↵Kostya Serebryany2013-02-142-1/+2
| | | | | | -I sanitizer_common/tests to asan/tests/CMakeLists.txt llvm-svn: 175142
* [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] Split ASan interface header into private and public parts. Add a test ↵Alexey Samsonov2013-01-311-1/+0
| | | | | | that makes sure users can include interface header llvm-svn: 174058
* 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
* [CMake] Fix compiler-rt tests after r173617Alexey Samsonov2013-01-281-2/+1
| | | | llvm-svn: 173668
* [sanitizer] improve the calloc overflow check (spotted by samsonov@)Kostya Serebryany2013-01-251-0/+9
| | | | llvm-svn: 173443
* [sanitizer] fix calloc overflow in asan/tsan/msanKostya Serebryany2013-01-251-0/+9
| | | | llvm-svn: 173441
* [asan] run-time tests for adaptive redzones Kostya Serebryany2013-01-243-0/+15
| | | | llvm-svn: 173336
* [asan] initialize kHighMemEnd at startup (instead of at compile time) to ↵Kostya Serebryany2013-01-231-0/+1
| | | | | | simplify further changes for various address space layouts. Fix asan_allocator2 for PowerPC (tested on 44-bit address space) llvm-svn: 173260
* [asan] simplify the code that poisons global redzones, add some more testsKostya Serebryany2013-01-234-3/+76
| | | | llvm-svn: 173251
* ASan: use Clang -fsanitize-blacklist flag in unit tests (instead of -mllvm)Alexey Samsonov2013-01-221-1/+1
| | | | llvm-svn: 173142
* ASan: simplify build rules for unit testsAlexey Samsonov2013-01-221-17/+19
| | | | llvm-svn: 173133
* ASan: disable flexible mapping and offset on Android. It doesn't work for ↵Alexey Samsonov2013-01-221-1/+2
| | | | | | dynamic ASan runtime there llvm-svn: 173132
* [asan] split asan_test.cc even moreKostya Serebryany2013-01-223-588/+575
| | | | llvm-svn: 173131
* [asan] split asan_test.cc moreKostya Serebryany2013-01-224-225/+257
| | | | llvm-svn: 173130
* [asan] split asan_test.cc to speedup parallel build (most important if ↵Kostya Serebryany2013-01-224-165/+181
| | | | | | building with a debug clang, which takes a couple of minutes on this large file with templates). More splits to follow llvm-svn: 173129
OpenPOWER on IntegriCloud