Fixes https://github.com/google/sanitizers/issues/788/, a deadlock
caused by multiple crashes happening at the same time. Before printing
a crash report, we now test and set an atomic flag. If the flag was
already set, the crash handler returns immediately.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
compiler-rt/lib/asan/asan_report.cc | ||
---|---|---|
137 ↗ | (On Diff #144595) | Will check-asan pass with this? |
compiler-rt/lib/fuzzer/FuzzerTracePC.cpp | ||
382 ↗ | (On Diff #144595) | I was thinking about implementing this function in sanitizer_common, and not making it weak. |
compiler-rt/lib/asan/asan_report.cc | ||
---|---|---|
137 ↗ | (On Diff #144595) | check-asan passes. This is defined weakly in sanitizer_common.cc, so it shouldn't be a nullptr. |
compiler-rt/lib/fuzzer/FuzzerTracePC.cpp | ||
382 ↗ | (On Diff #144595) | I defined it weakly in sanitizer_common.cc so that recovery mode shouldn't be affected. |
compiler-rt/lib/asan/asan_report.cc | ||
---|---|---|
137 ↗ | (On Diff #144595) | I would rather define this function (non-weak) in sanitizer_common and check halt_on_error_ before calling it there. |
compiler-rt/lib/sanitizer_common/sanitizer_common.cc | ||
---|---|---|
353 ↗ | (On Diff #144770) | redundant empty line |
compiler-rt/lib/sanitizer_common/sanitizer_interface_internal.h | ||
59 ↗ | (On Diff #144770) | Since this is used by libFuzzer, it's not an internal interface, but a public one, so move it to include/sanitizer/common_interface_defs.h |
compiler-rt/test/fuzzer/AcquireCrashStateTest.cpp | ||
10 ↗ | (On Diff #144770) | Instead of this, include sanitizer/common_interface_defs.h |
compiler-rt/lib/sanitizer_common/sanitizer_interface_internal.h | ||
---|---|---|
59 ↗ | (On Diff #144770) | Still kept this declaration also, following the pattern of other public interfaces that are defined internally. |