Commit d261567f authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[wasm][fuzzer] Make ClusterFuzz recognise OOM exceptions

Sometimes the second Wasm instantiation fails because we run out of
memory. This raises a RangeError, which is not recognized by ClusterFuzz
as OOM.
Thus turn it into a proper OOM crash.

R=ahaas@chromium.org

Bug: chromium:1347024
Change-Id: I39f7789cc85a9ba9b4217764fbbcef15c6c6ed76
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3784602Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81920}
parent 262d5fc3
...@@ -174,6 +174,12 @@ void InterpretAndExecuteModule(i::Isolate* isolate, ...@@ -174,6 +174,12 @@ void InterpretAndExecuteModule(i::Isolate* isolate,
{}) // no imports & memory {}) // no imports & memory
.ToHandle(&instance)) { .ToHandle(&instance)) {
DCHECK(thrower.error()); DCHECK(thrower.error());
// The only reason to fail the second instantiation should be OOM. Make
// this a proper OOM crash so that ClusterFuzz categorizes it as such.
if (strstr(thrower.error_msg(), "Out of memory")) {
V8::FatalProcessOutOfMemory(isolate, "Wasm fuzzer second instantiation",
thrower.error_msg());
}
FATAL("Second instantiation failed unexpectedly: %s", FATAL("Second instantiation failed unexpectedly: %s",
thrower.error_msg()); thrower.error_msg());
} }
......
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