llvm-project/compiler-rt/lib/asan/tests
Kostya Serebryany 667a34a120 [asan] Change the way we report the alloca frame on stack-buff-overflow.
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
2013-03-22 10:36:24 +00:00
..
CMakeLists.txt [asan] remove one redundant malloc stress test, unify the usage of ASAN_LOW_MEMORY macro in tests, slightly reduce test memory usage (all to make 32-bit runs consume less RAM) 2013-03-14 13:16:09 +00:00
asan_benchmarks_test.cc [ASan] Fix unit test headers. Add an option to change substitute asan_test_config.h file 2012-09-28 12:24:23 +00:00
asan_exceptions_test.cc [asan]: test a pure C file with -faddress-sanitizer; lint fixes 2011-12-05 20:44:30 +00:00
asan_globals_test.cc [asan] run-time tests for adaptive redzones 2013-01-24 10:36:11 +00:00
asan_mac_test.cc [ASan] Move Mac-specific tests to asan_mac_test.cc 2013-01-21 14:49:55 +00:00
asan_mac_test.h Intercept CFAllocator for each thread in the program. 2012-07-23 14:07:58 +00:00
asan_mac_test_helpers.mm [ASan] Move Mac-specific tests to asan_mac_test.cc 2013-01-21 14:49:55 +00:00
asan_mem_test.cc [asan] fix the output for range accesses (memset, etc); improve the tests; more strict checking in memcmp 2013-02-26 07:25:18 +00:00
asan_noinst_test.cc [asan] make the __asan_get_heap_size more robust 2013-03-18 10:52:25 +00:00
asan_oob_test.cc [asan] split asan_test.cc to speedup parallel build (most important if building with a debug clang, which takes a couple of minutes on this large file with templates). More splits to follow 2013-01-22 06:39:20 +00:00
asan_racy_double_free_test.cc [asan] fix lint 2012-03-28 21:03:34 +00:00
asan_str_test.cc [asan] split asan_test.cc even more 2013-01-22 07:01:47 +00:00
asan_test.cc [asan] Change the way we report the alloca frame on stack-buff-overflow. 2013-03-22 10:36:24 +00:00
asan_test.ignore [ASan] add comment to blacklist file to test behavior introduced in r166283 2012-10-19 15:26:48 +00:00
asan_test_config.h [asan] remove one redundant malloc stress test, unify the usage of ASAN_LOW_MEMORY macro in tests, slightly reduce test memory usage (all to make 32-bit runs consume less RAM) 2013-03-14 13:16:09 +00:00
asan_test_main.cc [ASan] unit tests: Move main() to a separate file. Fix lint 2012-10-17 14:04:57 +00:00
asan_test_utils.h [asan] use short path for sanitizer_common/tests/sanitizer_test_utils.h, add -I sanitizer_common/tests to asan/tests/CMakeLists.txt 2013-02-14 08:12:26 +00:00