Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: test/fuzzer/wasm-code.cc

Issue 2363663002: [wasm] Add hash to the crash message of the correctness fuzzer. (Closed)
Patch Set: Use a constant for the seed. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/fuzzer/wasm-code.cc
diff --git a/test/fuzzer/wasm-code.cc b/test/fuzzer/wasm-code.cc
index feb3e24618f8975cafa7d1ce5bbf7a0971cb28e8..75ce838fd23e44eefbc324b420e8ba974dc66964 100644
--- a/test/fuzzer/wasm-code.cc
+++ b/test/fuzzer/wasm-code.cc
@@ -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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698