Stop registering Windows VEH in ASAN builds.

ASAN injects a bad de-reference in HandleHeapCorruption() that causes it to be recursively invoked.

Bug: crashpad:464
Change-Id: I5e8db5555462166b963e0e43c6eb8ac0b327219e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4935953
Reviewed-by: Alex Gough <ajgo@chromium.org>
Commit-Queue: Rich Mckeever <mckeever@google.com>
This commit is contained in:
Rich Mckeever 2023-10-12 15:53:23 -04:00 committed by Crashpad LUCI CQ
parent 0fc1b6ae78
commit f145b54e83

View File

@ -667,15 +667,14 @@ void CrashpadClient::RegisterHandlers() {
SetUnhandledExceptionFilter(&UnhandledExceptionHandler); SetUnhandledExceptionFilter(&UnhandledExceptionHandler);
// Windows swallows heap corruption failures but we can intercept them with // Windows swallows heap corruption failures but we can intercept them with
// a vectored exception handler. // a vectored exception handler. Note that a vectored exception handler is
#if defined(ADDRESS_SANITIZER) // not compatible with or generally helpful in ASAN builds (ASAN inserts a
// Let ASAN have first go. // bad dereference at the beginning of the handler, leading to recursive
bool go_first = false; // invocation of the handler).
#else #if !defined(ADDRESS_SANITIZER)
bool go_first = true; PVOID handler = AddVectoredExceptionHandler(true, HandleHeapCorruption);
#endif
PVOID handler = AddVectoredExceptionHandler(go_first, HandleHeapCorruption);
vectored_handler_.reset(handler); vectored_handler_.reset(handler);
#endif
// The Windows CRT's signal.h lists: // The Windows CRT's signal.h lists:
// - SIGINT // - SIGINT