Avoid re-entrancy between __sanitizer::Report, OutputDebugString, and RtlRaiseException
Our Report implementation calls OutputDebugString, which calls RtlRaiseException, which can re-enter back into the ASan runtime and cause a hang. Don't treat this special debugger-only exception code as a noreturn event, since the stack won't really unwind all the way. llvm-svn: 277763
This commit is contained in:
parent
d938e88e89
commit
c696467530
|
|
@ -71,9 +71,12 @@ void __asan_default_on_error() {}
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
|
||||||
// ---------------------- Windows-specific interceptors ---------------- {{{
|
// ---------------------- Windows-specific interceptors ---------------- {{{
|
||||||
INTERCEPTOR_WINAPI(void, RtlRaiseException, void *ExceptionRecord) {
|
INTERCEPTOR_WINAPI(void, RtlRaiseException, EXCEPTION_RECORD *ExceptionRecord) {
|
||||||
CHECK(REAL(RtlRaiseException));
|
CHECK(REAL(RtlRaiseException));
|
||||||
__asan_handle_no_return();
|
// This is a noreturn function, unless it's one of the exceptions raised to
|
||||||
|
// communicate with the debugger, such as the one from OutputDebugString.
|
||||||
|
if (ExceptionRecord->ExceptionCode != DBG_PRINTEXCEPTION_C)
|
||||||
|
__asan_handle_no_return();
|
||||||
REAL(RtlRaiseException)(ExceptionRecord);
|
REAL(RtlRaiseException)(ExceptionRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue