[msan] Chained origins re-design.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Wed, 21 May 2014 09:02:13 +0000 (09:02 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Wed, 21 May 2014 09:02:13 +0000 (09:02 +0000)
commit208aae8ee0b581683bf25a602585bffc0c3968cc
treef2f825eb96ef174d2a0a362b7c4070fa6241488c
parente88161626f2ab30634051931962341058e2c781b
[msan] Chained origins re-design.

Generalize StackDepot and create a new specialized instance of it to
efficiently (i.e. without duplicating stack trace data) store the
origin history tree.

This reduces memory usage for chained origins roughly by an order of
magnitude.

Most importantly, this new design allows us to put two limits on
stored history data (exposed in MSAN_OPTIONS) that help avoid
exponential growth in used memory on certain workloads.

See comments in lib/msan/msan_origin.h for more details.

llvm-svn: 209284
22 files changed:
compiler-rt/include/sanitizer/msan_interface.h
compiler-rt/lib/asan/asan_stats.cc
compiler-rt/lib/msan/CMakeLists.txt
compiler-rt/lib/msan/msan.cc
compiler-rt/lib/msan/msan.h
compiler-rt/lib/msan/msan_allocator.cc
compiler-rt/lib/msan/msan_chained_origin_depot.cc [new file with mode: 0644]
compiler-rt/lib/msan/msan_chained_origin_depot.h [new file with mode: 0644]
compiler-rt/lib/msan/msan_flags.h
compiler-rt/lib/msan/msan_interceptors.cc
compiler-rt/lib/msan/msan_interface_internal.h
compiler-rt/lib/msan/msan_origin.h [new file with mode: 0644]
compiler-rt/lib/msan/msan_report.cc
compiler-rt/lib/msan/tests/msan_test.cc
compiler-rt/lib/sanitizer_common/CMakeLists.txt
compiler-rt/lib/sanitizer_common/sanitizer_common.h
compiler-rt/lib/sanitizer_common/sanitizer_persistent_allocator.cc [new file with mode: 0644]
compiler-rt/lib/sanitizer_common/sanitizer_persistent_allocator.h [new file with mode: 0644]
compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cc
compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.h
compiler-rt/lib/sanitizer_common/sanitizer_stackdepotbase.h [new file with mode: 0644]
compiler-rt/test/msan/chained_origin_limits.cc [new file with mode: 0644]