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