Log all of sanitizers' output (not just ASan bug reports) to CrashReport, which simplifies diagnosing failed checks as well as other errors. This also allows to strip the color sequences early from the printed buffer, which is more efficient than what we had perviously.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/sanitizer_common/sanitizer_mac.h | ||
---|---|---|
49 ↗ | (On Diff #42344) | Don't we need a lock here? Can we optimize the strcat here (by remembering the position where to append)? Or maybe we could unify this completely with AppendToErrorMessageBuffer (in asan_report.cc), which basically does the same thing. We could only have a single buffer to log into. |
lib/sanitizer_common/sanitizer_printf.cc | ||
283 ↗ | (On Diff #42344) | This means that CallPrintfAndReportCallback is now called on a color-less string. I'm actually in favor of this change, but we should make sure everyone's okay with it. |
lib/sanitizer_common/sanitizer_mac.h | ||
---|---|---|
49 ↗ | (On Diff #42344) |
Yes, we need it. Will address.
I am not convinced that increasing code complexity is worth it in this case. This is logging code...
Currently, AppendToErrorMessageBuffer is ASan specific. We should log output from any sanitizer. |
lib/sanitizer_common/sanitizer_printf.cc | ||
283 ↗ | (On Diff #42344) | Yes, calling CallPrintfAndReportCallback on a color-less string seems to be the right thing to do, at least to me. I can update the commit message to call this out. |
LGTM with a nit.
lib/sanitizer_common/sanitizer_mac.h | ||
---|---|---|
52 ↗ | (On Diff #42934) | Clang-format |
LGTM
lib/sanitizer_common/sanitizer_printf.cc | ||
---|---|---|
283 ↗ | (On Diff #42934) | Yes, I think it's fine. |