hanchenye-llvm-project/compiler-rt/lib/ubsan
Alexey Samsonov 8812e73c63 [UBSan] Allow UBSan location to store frames returned by symbolizer.
Summary:
__ubsan::getFunctionLocation() used to issue a call to symbolizer, and
convert the result (SymbolizedStack) to one of UBSan structures:
SourceLocation, ModuleLocation or MemoryLocation. This:
(1) is inefficient: we do an extra allocation/deallocation to copy data,
while we can instead can just pass SymbolizedStack around (which
contains all the necessary data).
(2) leaks memory: strings stored in SourceLocation/MemoryLocation are
never deallocated, and Filipe Cabecinhas suggests this causes crashes
of UBSan-ified programs in the wild.

Instead, let Location store a pointer to SymbolizedStack object, and
make sure it's properly deallocated when UBSan handler exits.

ModuleLocation is made obsolete by this change, and is deleted.

Test Plan: check-ubsan test suite

Reviewers: rsmith, filcab

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D7548

llvm-svn: 228869
2015-02-11 19:45:07 +00:00
..
CMakeLists.txt Revert "[UBSan] Enable -Wglobal-constructors." 2015-02-11 03:05:02 +00:00
Makefile.mk
ubsan.syms.extra Properly generate lists of exported symbols for sanitizer runtimes 2013-08-27 15:08:02 +00:00
ubsan_diag.cc [UBSan] Allow UBSan location to store frames returned by symbolizer. 2015-02-11 19:45:07 +00:00
ubsan_diag.h [UBSan] Allow UBSan location to store frames returned by symbolizer. 2015-02-11 19:45:07 +00:00
ubsan_flags.cc [asan] Allow changing verbosity in activation flags. 2015-01-20 13:21:20 +00:00
ubsan_flags.h [sanitizer] Flag parser rewrite. 2015-01-15 15:13:43 +00:00
ubsan_flags.inc [Sanitizer] Change the runtime flag representation. 2015-01-07 00:38:00 +00:00
ubsan_handlers.cc [UBSan] Allow UBSan location to store frames returned by symbolizer. 2015-02-11 19:45:07 +00:00
ubsan_handlers.h [UBSan] Add noinline attribute to handlers that should never return. 2014-09-10 20:43:36 +00:00
ubsan_handlers_cxx.cc [UBSan] Optionally report summary in UBSan error reports. 2014-09-19 18:33:45 +00:00
ubsan_handlers_cxx.h
ubsan_init.cc [sanitizer] Flag parser rewrite. 2015-01-15 15:13:43 +00:00
ubsan_init.h [UBSan] Call UBSan initialization as early as possible. 2014-07-25 22:24:34 +00:00
ubsan_type_hash.cc Revert "UBSan: Teach isDerivedFromAtOffset and findBaseAtOffset about vbases" 2014-12-30 00:33:50 +00:00
ubsan_type_hash.h
ubsan_value.cc [ubsan] handle long double in 32-bit mode; part of the patch by Marek Polacek 2014-05-23 14:45:13 +00:00
ubsan_value.h Enable UBSan on FreeBSD. Patch by Viktor Kutuzov. 2014-02-25 08:29:36 +00:00