From dbe797447da75897f97bfed5fa4f12ba27b179cf Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 7 Mar 2022 10:45:25 -0600 Subject: [PATCH] Fix table element limits in spectest fuzzer (#3888) Ensure that there's enough table elements allowed to execute the spec tests since some tests have a minimum required. --- crates/fuzzing/src/generators.rs | 2 ++ crates/fuzzing/src/oracles.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/fuzzing/src/generators.rs b/crates/fuzzing/src/generators.rs index c38dd55058..7f9bfbcbe3 100644 --- a/crates/fuzzing/src/generators.rs +++ b/crates/fuzzing/src/generators.rs @@ -354,6 +354,7 @@ impl Config { { limits.memories = 1; limits.tables = 5; + limits.table_elements = 1_000; // Set a lower bound of 10 pages as the spec tests define memories with at // least a few pages and some tests do memory grow operations. limits.memory_pages = std::cmp::max(limits.memory_pages, 10); @@ -370,6 +371,7 @@ impl Config { /// Converts this to a `wasmtime::Config` object pub fn to_wasmtime(&self) -> wasmtime::Config { crate::init_fuzzing(); + log::debug!("creating wasmtime config with {:#?}", self.wasmtime); let mut cfg = wasmtime::Config::new(); cfg.wasm_bulk_memory(true) diff --git a/crates/fuzzing/src/oracles.rs b/crates/fuzzing/src/oracles.rs index 8c7d09f625..7f88c61dc5 100644 --- a/crates/fuzzing/src/oracles.rs +++ b/crates/fuzzing/src/oracles.rs @@ -539,7 +539,7 @@ pub fn make_api_calls(api: generators::api::ApiCalls) { pub fn spectest(mut fuzz_config: generators::Config, test: generators::SpecTest) { crate::init_fuzzing(); fuzz_config.set_spectest_compliant(); - log::debug!("running {:?} with {:?}", test.file, fuzz_config); + log::debug!("running {:?}", test.file); let mut wast_context = WastContext::new(fuzz_config.to_store()); wast_context.register_spectest().unwrap(); wast_context