Skip to content

Commit f145b54

Browse files
richmckeeverCrashpad LUCI CQ
authored andcommitted
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>
1 parent 0fc1b6a commit f145b54

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

client/crashpad_client_win.cc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -667,15 +667,14 @@ void CrashpadClient::RegisterHandlers() {
667667
SetUnhandledExceptionFilter(&UnhandledExceptionHandler);
668668

669669
// Windows swallows heap corruption failures but we can intercept them with
670-
// a vectored exception handler.
671-
#if defined(ADDRESS_SANITIZER)
672-
// Let ASAN have first go.
673-
bool go_first = false;
674-
#else
675-
bool go_first = true;
676-
#endif
677-
PVOID handler = AddVectoredExceptionHandler(go_first, HandleHeapCorruption);
670+
// a vectored exception handler. Note that a vectored exception handler is
671+
// not compatible with or generally helpful in ASAN builds (ASAN inserts a
672+
// bad dereference at the beginning of the handler, leading to recursive
673+
// invocation of the handler).
674+
#if !defined(ADDRESS_SANITIZER)
675+
PVOID handler = AddVectoredExceptionHandler(true, HandleHeapCorruption);
678676
vectored_handler_.reset(handler);
677+
#endif
679678

680679
// The Windows CRT's signal.h lists:
681680
// - SIGINT

0 commit comments

Comments
 (0)