Commit 3a75c1fb authored by Paolo Severini's avatar Paolo Severini Committed by Commit Bot

Fixing a possible freeze on abort with 'v8_win64_unwinding_info'

Win64 unwind data can specify a language-specific handler function which is
called as part of the search for an exception handler, as described in
https://docs.microsoft.com/en-us/cpp/build/exception-handling-x64?view=vs-2019.
This is used for example by Crashpad to register its own exception handler for
exceptions in V8-generated code.
There is a problem in the code that may cause a freeze on abort: in file
\deps\v8\src\unwinding-info-win64.cc in function CRASH_HANDLER_FUNCTION_NAME the
line:
    return EXCEPTION_CONTINUE_SEARCH;
should be
    return ExceptionContinueSearch;

These constants are both used in the context of Win32 exception handlers, but
they have different semantics and unfortunately different values:
EXCEPTION_CONTINUE_SEARCH (=0) should be returned by an exception filter
while a language-specific handler should return an EXCEPTION_DISPOSITION value,
and more precisely ExceptionContinueSearch (=1) in this case.

Bug: v8:9295
Change-Id: I1a3aaabf357e52a909611814f1ea013cf652ae06
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1629795Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Paolo Severini <paolosev@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#61867}
parent 53c3d747
...@@ -107,7 +107,7 @@ extern "C" __declspec(dllexport) int CRASH_HANDLER_FUNCTION_NAME( ...@@ -107,7 +107,7 @@ extern "C" __declspec(dllexport) int CRASH_HANDLER_FUNCTION_NAME(
EXCEPTION_POINTERS info = {ExceptionRecord, ContextRecord}; EXCEPTION_POINTERS info = {ExceptionRecord, ContextRecord};
return unhandled_exception_callback_g(&info); return unhandled_exception_callback_g(&info);
} }
return EXCEPTION_CONTINUE_SEARCH; return ExceptionContinueSearch;
} }
static constexpr int kMaxExceptionThunkSize = 12; static constexpr int kMaxExceptionThunkSize = 12;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment