Skip to content

Commit ac38ab5

Browse files
authored
[lsan] Use VReport if not REGISTERS_AVAILABLE (llvm#116555)
Certain tests (many are from lld/test) run `... '2>&1 | count 0` to ensure that there is no stderr message. GetRegistersAndSP may rarely fail, leading to a spurious failure like (with a local hack to make `count` dump the input): ``` + /home/ray/llvm/out/asan/bin/ld.lld func1-gcs.o func2-gcs.o func3-gcs.o -o /dev/null -z gcs-report=warning -z gcs=never + /home/ray/llvm/out/asan/bin/count 0 Expected 0 lines, got 1. ==2403039==Unable to get registers from thread 2403018. ``` The failure can reliably be reproduced by running `ninja check-lld` a few times under asan+lsan (see the bot sanitizer-x86_64-linux-bootstrap-asan).
1 parent d49ee7d commit ac38ab5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-rt/lib/lsan/lsan_common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ static void ProcessThreads(SuspendedThreadsList const &suspended_threads,
569569
PtraceRegistersStatus have_registers =
570570
suspended_threads.GetRegistersAndSP(i, &registers, &sp);
571571
if (have_registers != REGISTERS_AVAILABLE) {
572-
Report("Unable to get registers from thread %llu.\n", os_id);
572+
VReport(1, "Unable to get registers from thread %llu.\n", os_id);
573573
// If unable to get SP, consider the entire stack to be reachable unless
574574
// GetRegistersAndSP failed with ESRCH.
575575
if (have_registers == REGISTERS_UNAVAILABLE_FATAL)

0 commit comments

Comments
 (0)