llvm-project/compiler-rt/test
Dan Liew 445b810fbd [ASan] Fix issue where system log buffer was not cleared after reporting an issue.
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
2020-03-26 10:56:17 -07:00
..
BlocksRuntime Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
asan [ASan] Fix issue where system log buffer was not cleared after reporting an issue. 2020-03-26 10:56:17 -07:00
builtins [compiler-rt] [builtins] Fix logb / logbl tests 2020-02-20 10:16:03 +00:00
cfi [cfi][test] cross-dso/stats.cpp: don't assume the order of static constructors 2020-01-08 15:50:51 -08:00
crt Fix include guard and properly order __deregister_frame_info. 2019-11-12 14:54:41 -08:00
dfsan [DFSan] Add __dfsan_cmp_callback. 2020-02-28 15:49:44 -08:00
fuzzer [libFuzzer] Fix denominator in the "inputs have DFT" log line. 2020-02-19 11:05:14 -08:00
gwp_asan [GWP-ASan] Crash Handler API. 2020-02-05 15:39:17 -08:00
hwasan [compiler-rt] libhwasan interceptor ABI intercept longjmp/setjmp 2019-10-30 14:04:40 +00:00
interception [compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.* 2019-06-27 20:56:04 +00:00
lsan [compiler-rt] [test] Disable ASLR on LSAN+ASAN tests on NetBSD 2019-12-18 17:21:14 +01:00
msan [msan] Fix sigaltstack false positive. 2020-03-23 16:17:31 -07:00
profile [Coverage] Collect all function records in an object (D69471 followup) 2020-03-02 12:01:09 -08:00
safestack compiler-rt: Remove .cc from all lit config files 2019-08-05 19:25:35 +00:00
sanitizer_common [compiler-rt] Intercept the uname() function 2020-03-23 12:59:38 -07:00
scudo [Scudo] [GWP-ASan] Add GWP-ASan to Scudo Standalone. 2019-12-13 09:09:41 -08:00
shadowcallstack compiler-rt: Remove .cc from all lit config files 2019-08-05 19:25:35 +00:00
tsan Revert "tsan: fix leak of ThreadSignalContext for fibers" 2020-03-25 19:18:38 -07:00
ubsan Port ubsan nullability.c test to Windows 2020-03-03 13:18:58 -08:00
ubsan_minimal [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour 2019-10-10 09:25:02 +00:00
xray [compiler-rt] [test] Disable MPROTECT for XRay tests on NetBSD 2019-12-20 22:08:01 +01:00
.clang-format [compiler-rt] Use "ColumnLimit: 0" instead of "clang-format off" in tests 2018-12-01 01:24:29 +00:00
CMakeLists.txt [compiler-rt] Disable fuzzer large.test when LLVM_ENABLE_EXPENSIVE_CHECKS=ON 2019-12-03 14:37:37 -08:00
lit.common.cfg.py [ASan] Fix issue where system log buffer was not cleared after reporting an issue. 2020-03-26 10:56:17 -07:00
lit.common.configured.in Revert abb00753 "build: reduce CMake handling for zlib" (PR44780) 2020-03-03 11:03:09 +01:00