Commit 78b048c0 authored by ahaas's avatar ahaas Committed by Commit bot

[wasm] Add hash to the crash message of the correctness fuzzer.

The hash in the crash message is necessary to keep cluster fuzz from
grouping all result mismatches.

R=titzer@chromium.org, mmoroz@chromium.org

Review-Url: https://codereview.chromium.org/2363663002
Cr-Commit-Position: refs/heads/master@{#39625}
parent de42ed28
......@@ -7,6 +7,7 @@
#include "include/v8.h"
#include "src/isolate.h"
#include "src/objects.h"
#include "src/wasm/encoder.h"
#include "src/wasm/wasm-interpreter.h"
#include "src/wasm/wasm-module.h"
......@@ -14,6 +15,8 @@
#include "test/common/wasm/wasm-module-runner.h"
#include "test/fuzzer/fuzzer-support.h"
#define WASM_CODE_FUZZER_HASH_SEED 83
using namespace v8::internal::wasm;
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
......@@ -92,6 +95,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
CHECK(i_isolate->has_pending_exception());
i_isolate->clear_pending_exception();
} else {
if (result_interpreted != result_compiled) {
V8_Fatal(
__FILE__, __LINE__,
"Interpreter result (%d) != compiled module result (%d). Hash: %u",
result_interpreted, result_compiled,
v8::internal::StringHasher::HashSequentialString(
data, static_cast<int>(size), WASM_CODE_FUZZER_HASH_SEED));
}
CHECK_EQ(result_interpreted, result_compiled);
}
return 0;
......
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