From 25d3fa4d7b944b4341928a401c57feaaa0ce3c35 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 30 Sep 2021 13:09:19 -0500 Subject: [PATCH] Remove spec interpreter fuzz target temporarily (#3399) This commit removes the `differential_spec` fuzz target for now, although this removal is intended to be temporary. We have #3251 to track re-enabling the spec interpreter in a way that it won't time out, and additionally the spec interpreter is also failing to build with ocaml on oss-fuzz so that will also need to be investigated when re-enabling. --- crates/fuzzing/Cargo.toml | 5 +-- .../fuzzing/wasm-spec-interpreter/src/lib.rs | 5 +-- fuzz/Cargo.toml | 6 ---- fuzz/fuzz_targets/differential_spec.rs | 31 ------------------- 4 files changed, 6 insertions(+), 41 deletions(-) delete mode 100644 fuzz/fuzz_targets/differential_spec.rs diff --git a/crates/fuzzing/Cargo.toml b/crates/fuzzing/Cargo.toml index 4e6a0ca746..fcdcfac483 100644 --- a/crates/fuzzing/Cargo.toml +++ b/crates/fuzzing/Cargo.toml @@ -32,7 +32,8 @@ rusty_v8 = "0.27" [dev-dependencies] wat = "1.0.37" +# FIXME(#3251) should re-enable once spec interpreter won't time out # We only build the library containing the OCaml spec interpreter if the OCaml # toolchain is available--which is assumed here to be the case when fuzzing. -[target.'cfg(fuzzing)'.dependencies] -wasm-spec-interpreter = { path = "./wasm-spec-interpreter", features = ["build-libinterpret"] } +# [target.'cfg(fuzzing)'.dependencies] +# wasm-spec-interpreter = { path = "./wasm-spec-interpreter", features = ["build-libinterpret"] } diff --git a/crates/fuzzing/wasm-spec-interpreter/src/lib.rs b/crates/fuzzing/wasm-spec-interpreter/src/lib.rs index a2f46a3a9a..20440c500e 100644 --- a/crates/fuzzing/wasm-spec-interpreter/src/lib.rs +++ b/crates/fuzzing/wasm-spec-interpreter/src/lib.rs @@ -28,6 +28,7 @@ mod without_library; #[cfg(not(feature = "has-libinterpret"))] pub use without_library::*; +// FIXME(#3251) should re-enable once spec interpreter won't time out // If the user is fuzzing`, we expect the OCaml library to have been built. -#[cfg(all(fuzzing, not(feature = "has-libinterpret")))] -compile_error!("The OCaml library was not built."); +// #[cfg(all(fuzzing, not(feature = "has-libinterpret")))] +// compile_error!("The OCaml library was not built."); diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 9f30a38326..b673450ba3 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -52,12 +52,6 @@ path = "fuzz_targets/differential.rs" test = false doc = false -[[bin]] -name = "differential_spec" -path = "fuzz_targets/differential_spec.rs" -test = false -doc = false - [[bin]] name = "differential_wasmi" path = "fuzz_targets/differential_wasmi.rs" diff --git a/fuzz/fuzz_targets/differential_spec.rs b/fuzz/fuzz_targets/differential_spec.rs deleted file mode 100644 index 3116d24a0a..0000000000 --- a/fuzz/fuzz_targets/differential_spec.rs +++ /dev/null @@ -1,31 +0,0 @@ -#![no_main] - -use libfuzzer_sys::fuzz_target; -use std::sync::atomic::{AtomicUsize, Ordering::SeqCst}; -use wasmtime_fuzzing::{generators, oracles}; - -// Keep track of how many WebAssembly modules we actually executed (i.e. ran to -// completion) versus how many were tried. -static TRIED: AtomicUsize = AtomicUsize::new(0); -static EXECUTED: AtomicUsize = AtomicUsize::new(0); - -fuzz_target!(|data: ( - generators::Config, - wasm_smith::ConfiguredModule> -)| { - let (config, mut wasm) = data; - wasm.module.ensure_termination(1000); - let tried = TRIED.fetch_add(1, SeqCst); - let executed = match oracles::differential_spec_execution(&wasm.module.to_bytes(), &config) { - Some(_) => EXECUTED.fetch_add(1, SeqCst), - None => EXECUTED.load(SeqCst), - }; - if tried > 0 && tried % 1000 == 0 { - println!( - "=== Execution rate ({} executed modules / {} tried modules): {}% ===", - executed, - tried, - executed as f64 / tried as f64 * 100f64 - ) - } -});