From 1f7721b1a2fccc41891eb1be3f864f4fa65a356c Mon Sep 17 00:00:00 2001 From: Clemens Backes Date: Mon, 11 Jan 2021 17:07:23 +0100 Subject: [PATCH] [inspector][fuzzer] Fix timeouts on endless loops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The watchdog previously didn't terminate execution, it just prevented the execution of additional tasks. This CL fixes that by making {TaskRunner::Terminate} actually terminate execution in the isolate. It also adds a regression test for this. R=szuend@chromium.org Bug: chromium:1154412, chromium:1142437 Change-Id: Ic6638e8a5c37e8840a85651b4d4bea2ee0f71c43 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2622212 Reviewed-by: Simon Zünd Commit-Queue: Clemens Backes Cr-Commit-Position: refs/heads/master@{#72031} --- test/fuzzer/inspector/endless-loop | 1 + test/inspector/task-runner.cc | 1 + 2 files changed, 2 insertions(+) create mode 100644 test/fuzzer/inspector/endless-loop diff --git a/test/fuzzer/inspector/endless-loop b/test/fuzzer/inspector/endless-loop new file mode 100644 index 0000000000..bffbd3679e --- /dev/null +++ b/test/fuzzer/inspector/endless-loop @@ -0,0 +1 @@ +while (1) {} diff --git a/test/inspector/task-runner.cc b/test/inspector/task-runner.cc index b0979e0f33..65fbeb4d6b 100644 --- a/test/inspector/task-runner.cc +++ b/test/inspector/task-runner.cc @@ -116,6 +116,7 @@ void TaskRunner::Append(std::unique_ptr task) { void TaskRunner::Terminate() { is_terminated_++; + isolate()->TerminateExecution(); process_queue_semaphore_.Signal(); }