[GWP-ASan] Add generic unwinders and structure backtrace output.
authorMitch Phillips <mitchphillips@outlook.com>
Tue, 2 Jul 2019 16:04:52 +0000 (16:04 +0000)
committerMitch Phillips <mitchphillips@outlook.com>
Tue, 2 Jul 2019 16:04:52 +0000 (16:04 +0000)
commit7339ca278c3fdb1d932b776005b2687ec11eadae
tree8089f4e9f36a99a0396c0597455fe3aa07070ee6
parentcb1a5a705c78bc8247e3d10bf9df383f571e0d01
[GWP-ASan] Add generic unwinders and structure backtrace output.

Summary:
Adds two flavours of generic unwinder and all the supporting cruft. If the
supporting allocator is okay with bringing in sanitizer_common, they can use
the fast frame-pointer based unwinder from sanitizer_common. Otherwise, we also
provide the backtrace() libc-based unwinder as well. Of course, the allocator
can always specify its own unwinder and unwinder-symbolizer.

The slightly changed output format is exemplified in the first comment on this
patch. It now better incorporates backtrace information, and displays
allocation details on the second line.

Reviewers: eugenis, vlad.tsyrklevich

Reviewed By: eugenis, vlad.tsyrklevich

Subscribers: srhines, kubamracek, mgorny, cryptoad, #sanitizers, llvm-commits, morehouse

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D63841

llvm-svn: 364941
24 files changed:
compiler-rt/lib/gwp_asan/CMakeLists.txt
compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp
compiler-rt/lib/gwp_asan/guarded_pool_allocator.h
compiler-rt/lib/gwp_asan/optional/backtrace.h [new file with mode: 0644]
compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp [new file with mode: 0644]
compiler-rt/lib/gwp_asan/optional/backtrace_sanitizer_common.cpp [new file with mode: 0644]
compiler-rt/lib/gwp_asan/optional/options_parser.cpp
compiler-rt/lib/gwp_asan/optional/options_parser.h
compiler-rt/lib/gwp_asan/options.h
compiler-rt/lib/gwp_asan/tests/CMakeLists.txt
compiler-rt/lib/gwp_asan/tests/backtrace.cpp [new file with mode: 0644]
compiler-rt/lib/gwp_asan/tests/harness.h
compiler-rt/test/gwp_asan/double_delete.cpp
compiler-rt/test/gwp_asan/double_deletea.cpp
compiler-rt/test/gwp_asan/double_free.cpp
compiler-rt/test/gwp_asan/heap_buffer_overflow.cpp
compiler-rt/test/gwp_asan/heap_buffer_underflow.cpp
compiler-rt/test/gwp_asan/invalid_free_left.cpp
compiler-rt/test/gwp_asan/invalid_free_right.cpp
compiler-rt/test/gwp_asan/lit.cfg.py
compiler-rt/test/gwp_asan/realloc.cpp
compiler-rt/test/gwp_asan/use_after_delete.cpp
compiler-rt/test/gwp_asan/use_after_deletea.cpp
compiler-rt/test/gwp_asan/use_after_free.cpp