[wasm][debug] Handle exceptions in interrupts

This was triggered by the inspector fuzzer, which terminates execution
after two seconds. This is done by triggering a termination exception
via an interrupt. In this case, the runtime function should return
immediately, and return the exception sentinel.
This CL fixes the WasmDebugBreak runtime function to do that correctly.

R=thibaudm@chromium.org

Bug: chromium:1215711
Change-Id: Idf8e9769809f135b426e4d1a0ef82fae826050b4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3041423
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75838}
This commit is contained in:
Clemens Backes 2021-07-20 14:40:23 +02:00 committed by V8 LUCI CQ
parent 930555e2f4
commit ee6ad641a0

View File

@ -559,7 +559,13 @@ RUNTIME_FUNCTION(Runtime_WasmDebugBreak) {
// Stepping can repeatedly create code, and code GC requires stack guards to
// be executed on all involved isolates. Proactively do this here.
StackLimitCheck check(isolate);
if (check.InterruptRequested()) isolate->stack_guard()->HandleInterrupts();
if (check.InterruptRequested()) {
Object interrupt_object = isolate->stack_guard()->HandleInterrupts();
// Interrupt handling can create an exception, including the
// termination exception.
if (interrupt_object.IsException(isolate)) return interrupt_object;
DCHECK(interrupt_object.IsUndefined(isolate));
}
// Enter the debugger.
DebugScope debug_scope(isolate->debug());