summaryrefslogtreecommitdiff
path: root/lib/asan/tests
Commit message (Collapse)AuthorAge
* [ASan] Kill use_stack_depot runtime flag and stack trace compression routines.Alexey Samsonov2013-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193868 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Maybe fix test failures on lld bots.Evgeniy Stepanov2013-10-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193647 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Remove CallocOverflow32 test from asan_test.Evgeniy Stepanov2013-10-16
| | | | | | | | The same as with MSan, this test behavior depends on ASAN_OPTIONS, and we've got a lit_test that covers this. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192777 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] introduce run-time flag uar_stack_size_log to control the size of ↵Kostya Serebryany2013-09-27
| | | | | | FakeStack; don't crash when the fake stack is exhausted, move some code to .cc file git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191510 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Fix GCD tests by spinning forever in the main thread.Alexander Potapenko2013-09-24
| | | | | | | Since the error is always reported by one of the GCD workers, this will help avoid premature program termination with exit code 0. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191294 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] remove -fsanitize=use-after-return from the tests (this flag now ↵Kostya Serebryany2013-09-23
| | | | | | comes with asan by default) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191204 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Fix compilation of asan_str_test.cc on non-Darwin.Alexander Potapenko2013-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191083 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Enforce the memmove semantics for both memcpy() and memmove() ↵Alexander Potapenko2013-09-20
| | | | | | | | | | | | | | interceptors on Darwin. Due to bugs in the interposition of resolver functions on 10.7 and 10.8 both memcpy() and memmove() were previously intercepted by INTERCEPTOR(memcpy), which led to false positives and crashes (see http://llvm.org/bugs/show_bug.cgi?id=16362) We choose to use a memmove-like function in both cases. This effectively disables the overlap checks in memcpy(), but the overlaps aren't possible in practice, because memcpy() and memmove() are the same function on Darwin. Once the interposition is fixed in 10.9, we'll need to revisit this issue, see https://code.google.com/p/address-sanitizer/issues/detail?id=226 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191081 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Enable fake stack test on Mac and Android, as no-instrumentation ↵Alexey Samsonov2013-09-17
| | | | | | tests are now fixed git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190856 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Link tests with -pie if ASan runtime uses zero-base shadowAlexey Samsonov2013-09-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190853 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] further speedup use-after-return: simplify deallocation of fake ↵Kostya Serebryany2013-09-17
| | | | | | frames. ~ 20% speedup. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190852 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Don't link with pthread on AndroidAlexey Samsonov2013-09-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190794 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Split ASan unit tests into two different binaries:Alexey Samsonov2013-09-16
| | | | | | | | (1) instrumented, i.e. compiled and linked with -fsanitize=address (2) not instrumented, compiled w/o -fsanitize=address and linked with ASan runtime statically. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190788 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Temporary disable UAR unit test on Android due to ↵Alexey Samsonov2013-09-13
| | | | | | https://code.google.com/p/address-sanitizer/issues/detail?id=222 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190667 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] don't record the class_id in FakeFrame (scratching the last bits of ↵Kostya Serebryany2013-09-13
| | | | | | performance) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190666 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] a bit of performance improvement in fake stack, generalized one test, ↵Kostya Serebryany2013-09-12
| | | | | | fixed android build of another test git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190606 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Do not build asan_fake_stack_test.cc on OSX until ↵Alexander Potapenko2013-09-12
| | | | | | https://code.google.com/p/address-sanitizer/issues/detail?id=222 is fixed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190597 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] fully re-implement the FakeStack (use-after-return) to make it faster ↵Kostya Serebryany2013-09-12
| | | | | | and async-signal-safe. The implementation is not yet complete (see FIXMEs) but the existing tests pass. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190588 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] refactor the use-after-return API so that the size class is computed ↵Kostya Serebryany2013-09-10
| | | | | | at compile time instead of at run-time. compiler-rt part git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190406 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] turn on leak checking for ASan tests and fix a few discovered leaksAlexey Samsonov2013-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190274 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix compiler warning introduced in r190022Alexey Samsonov2013-09-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190137 91177308-0d34-0410-b5e6-96231b3b80d8
* Migrate ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS to new spelling - ↵Alexey Samsonov2013-09-06
| | | | | | ATTRIBUTE_NO_SANITIZE_ADDRESS git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190136 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] make calloc crash instead of returning 0 on overflow (controlled by ↵Kostya Serebryany2013-09-06
| | | | | | the allocator_may_return_null flag) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190128 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] make the allocator crash instead of returning 0 on huge size ↵Kostya Serebryany2013-09-06
| | | | | | (controlled by the allocator_may_return_null flag) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190127 91177308-0d34-0410-b5e6-96231b3b80d8
* asan: Add a wcslen interceptor mirroring strlenReid Kleckner2013-09-05
| | | | | | Tested on Linux, since I can't build the tests on Windows yet. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190022 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan]: fix a CHECK failure in use-after-return mode; enable and fix ↵Kostya Serebryany2013-08-28
| | | | | | stack-use-after-return.cc; add a test for UAR mode in asan_noinst_test git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189457 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Fix leaks in ASan tests found by LSanAlexey Samsonov2013-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@186577 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] fix the bug with memalign and malloc_usable_size ↵Kostya Serebryany2013-06-10
| | | | | | (http://code.google.com/p/address-sanitizer/issues/detail?id=193); also fix lint git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183647 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] make pthread_getschedparam test more robustAlexey Samsonov2013-06-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183411 91177308-0d34-0410-b5e6-96231b3b80d8
* Call __asan_free_hook() before marking the chunk quarantinnedAlexey Samsonov2013-06-04
| | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183220 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] workaround for asan bug 189 (swapcontext followed by throw gets OOM ↵Kostya Serebryany2013-05-22
| | | | | | kill). Also, disable swapcontext_test on non-x86. Fix lint git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182456 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Intercept pthread_getschedparam.Evgeniy Stepanov2013-05-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182353 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix realloc'ing freed/invalid pointersTimur Iskhodzhanov2013-05-20
| | | | | | See https://code.google.com/p/address-sanitizer/issues/detail?id=187 for the details git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182255 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] fix ShadowGapTest on PowerPC64Kostya Serebryany2013-05-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181991 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] disable BuiltinLongJmpTest on PowerPCKostya Serebryany2013-05-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181890 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] fix powerpc build and one test; fix lintKostya Serebryany2013-05-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181881 91177308-0d34-0410-b5e6-96231b3b80d8
* Quick fix for ASan test build on Android.Sergey Matveev2013-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181429 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Disable AddressSanitizer.AllocDeallocMismatch on Darwin.Alexander Potapenko2013-04-23
| | | | | | | See https://code.google.com/p/address-sanitizer/issues/detail?id=131. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@180093 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] nuke the old unused allocator codeKostya Serebryany2013-04-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@178758 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Change the way we report the alloca frame on stack-buff-overflow.Kostya Serebryany2013-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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' git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177723 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Fix an error on invalid deallocation in ASan allocator. When ASan ↵Alexey Samsonov2013-03-22
| | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177710 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] make the __asan_get_heap_size more robustKostya Serebryany2013-03-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177270 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Switch to allocator2 on Android.Evgeniy Stepanov2013-03-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177263 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] remove one redundant malloc stress test, unify the usage of ↵Kostya Serebryany2013-03-14
| | | | | | ASAN_LOW_MEMORY macro in tests, slightly reduce test memory usage (all to make 32-bit runs consume less RAM) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177069 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Revert r176255, r176264.Evgeniy Stepanov2013-03-01
| | | | | | | New allocator has 1.5x memory overhead of the old one. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176340 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Lower memory usage in LargeMallocTest on Android.Evgeniy Stepanov2013-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176264 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] if calloc returns a freshly-mmaped memory, don't clear it with ↵Kostya Serebryany2013-02-27
| | | | | | memset. Speeds up calloc-intensive code git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176185 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] fix the output for range accesses (memset, etc); improve the tests; ↵Kostya Serebryany2013-02-26
| | | | | | more strict checking in memcmp git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176078 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] speedup by more than 2x handling of the small memset/memcpy/etc callsKostya Serebryany2013-02-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@175728 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] revert part of r175631 that looks like accidental commitAlexey Samsonov2013-02-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@175655 91177308-0d34-0410-b5e6-96231b3b80d8