[compiler-rt] [ASan] Prevent ASan/LSan deadlock by preloading modules before error reporting (PR #131756)

Daniel Thornburgh via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 18 16:05:11 PDT 2025


mysterymath wrote:

Independently from Darwin, I've noticed this is a source of flakiness on our Linux x64 builders. It failed the 5 most recent runs, passed the proceeding 4, but failed the proceeding 2. 

Failure message:
```
/b/s/w/ir/x/w/llvm-llvm-project/compiler-rt/test/asan/TestCases/asan_lsan_deadlock.cpp:61:12: error: CHECK: expected string not found in input
 // CHECK: SUMMARY: AddressSanitizer: stack-buffer-overflow
           ^
<stdin>:1:1: note: scanning from here
=================================================================
^
<stdin>:2:10: note: possible intended match here
==3675852==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7b55e78de034 at pc 0x5602bfdd6f00 bp 0x7b55e5afdcb0 sp 0x7b55e5afdca8
         ^

Input file: <stdin>
Check file: /b/s/w/ir/x/w/llvm-llvm-project/compiler-rt/test/asan/TestCases/asan_lsan_deadlock.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: ================================================================= 
check:61'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
            2: ==3675852==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7b55e78de034 at pc 0x5602bfdd6f00 bp 0x7b55e5afdcb0 sp 0x7b55e5afdca8 
check:61'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:61'1              ?                                                                                                                                    possible intended match
            3: WRITE of size 4 at 0x7b55e78de034 thread T2 
check:61'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            4: Timeout! Deadlock detected. 
check:61'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>

--
```

Example failure:
https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8717213898721101697/overview

Builder history:
https://luci-milo.appspot.com/ui/p/fuchsia/builders/luci.fuchsia.toolchain.ci/clang-linux-x64

https://github.com/llvm/llvm-project/pull/131756


More information about the llvm-commits mailing list