forked from OSchip/llvm-project
445b810fbd
Summary: When ASan reports an issue the contents of the system log buffer (`error_message_buffer`) get flushed to the system log (via `LogFullErrorReport()`). After this happens the buffer is not cleared but this is usually fine because the process usually exits soon after reporting the issue. However, when ASan runs in `halt_on_error=0` mode execution continues without clearing the buffer. This leads to problems if more ASan issues are found and reported. 1. Duplicate ASan reports in the system log. The Nth (start counting from 1) ASan report will be duplicated (M - N) times in the system log if M is the number of ASan issues reported. 2. Lost ASan reports. Given a sufficient number of reports the buffer will fill up and consequently cannot be appended to. This means reports can be lost. The fix here is to reset `error_message_buffer_pos` to 0 which effectively clears the system log buffer. A test case is included but unfortunately it is Darwin specific because querying the system log is an OS specific activity. rdar://problem/55986279 Reviewers: kubamracek, yln, vitalybuka, kcc, filcab Subscribers: #sanitizers, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D76749 |
||
---|---|---|
.. | ||
scripts | ||
tests | ||
.clang-format | ||
CMakeLists.txt | ||
README.txt | ||
asan.syms.extra | ||
asan_activation.cpp | ||
asan_activation.h | ||
asan_activation_flags.inc | ||
asan_allocator.cpp | ||
asan_allocator.h | ||
asan_blacklist.txt | ||
asan_debugging.cpp | ||
asan_descriptions.cpp | ||
asan_descriptions.h | ||
asan_errors.cpp | ||
asan_errors.h | ||
asan_fake_stack.cpp | ||
asan_fake_stack.h | ||
asan_flags.cpp | ||
asan_flags.h | ||
asan_flags.inc | ||
asan_fuchsia.cpp | ||
asan_globals.cpp | ||
asan_globals_win.cpp | ||
asan_init_version.h | ||
asan_interceptors.cpp | ||
asan_interceptors.h | ||
asan_interceptors_memintrinsics.cpp | ||
asan_interceptors_memintrinsics.h | ||
asan_interceptors_vfork.S | ||
asan_interface.inc | ||
asan_interface_internal.h | ||
asan_internal.h | ||
asan_linux.cpp | ||
asan_lock.h | ||
asan_mac.cpp | ||
asan_malloc_linux.cpp | ||
asan_malloc_local.h | ||
asan_malloc_mac.cpp | ||
asan_malloc_win.cpp | ||
asan_mapping.h | ||
asan_mapping_myriad.h | ||
asan_mapping_sparc64.h | ||
asan_memory_profile.cpp | ||
asan_new_delete.cpp | ||
asan_poisoning.cpp | ||
asan_poisoning.h | ||
asan_posix.cpp | ||
asan_preinit.cpp | ||
asan_premap_shadow.cpp | ||
asan_premap_shadow.h | ||
asan_report.cpp | ||
asan_report.h | ||
asan_rtems.cpp | ||
asan_rtl.cpp | ||
asan_scariness_score.h | ||
asan_shadow_setup.cpp | ||
asan_stack.cpp | ||
asan_stack.h | ||
asan_stats.cpp | ||
asan_stats.h | ||
asan_suppressions.cpp | ||
asan_suppressions.h | ||
asan_thread.cpp | ||
asan_thread.h | ||
asan_win.cpp | ||
asan_win_dll_thunk.cpp | ||
asan_win_dynamic_runtime_thunk.cpp | ||
asan_win_weak_interception.cpp | ||
weak_symbols.txt |
README.txt
AddressSanitizer RT ================================ This directory contains sources of the AddressSanitizer (ASan) runtime library. Directory structure: README.txt : This file. Makefile.mk : File for make-based build. CMakeLists.txt : File for cmake-based build. asan_*.{cc,h} : Sources of the asan runtime library. scripts/* : Helper scripts. tests/* : ASan unit tests. Also ASan runtime needs the following libraries: lib/interception/ : Machinery used to intercept function calls. lib/sanitizer_common/ : Code shared between various sanitizers. ASan runtime currently also embeds part of LeakSanitizer runtime for leak detection (lib/lsan/lsan_common.{cc,h}). ASan runtime can only be built by CMake. You can run ASan tests from the root of your CMake build tree: make check-asan For more instructions see: https://github.com/google/sanitizers/wiki/AddressSanitizerHowToBuild