diff --git a/crates/fuzzing/src/oracles.rs b/crates/fuzzing/src/oracles.rs index 8a08b0108da0..d154904204b0 100644 --- a/crates/fuzzing/src/oracles.rs +++ b/crates/fuzzing/src/oracles.rs @@ -255,9 +255,7 @@ fn compile_module( Ok(module) => Some(module), Err(_) if !known_valid => None, Err(e) => { - if let generators::InstanceAllocationStrategy::Pooling { .. } = - &config.wasmtime.strategy - { + if let generators::InstanceAllocationStrategy::Pooling(c) = &config.wasmtime.strategy { // When using the pooling allocator, accept failures to compile // when arbitrary table element limits have been exceeded as // there is currently no way to constrain the generated module @@ -275,6 +273,23 @@ fn compile_module( if string.contains("instance allocation for this module requires") { return None; } + + // If the pooling allocator is more restrictive on the number of + // tables and memories than we allowed wasm-smith to generate + // then allow compilation errors along those lines. + if c.max_tables_per_module < (config.module_config.config.max_tables as u32) + && string.contains("defined tables count") + && string.contains("exceeds the per-instance limit") + { + return None; + } + + if c.max_memories_per_module < (config.module_config.config.max_memories as u32) + && string.contains("defined memories count") + && string.contains("exceeds the per-instance limit") + { + return None; + } } panic!("failed to compile module: {:?}", e); @@ -329,7 +344,7 @@ pub fn instantiate_with_dummy(store: &mut Store, module: &Module) - } // Also allow failures to instantiate as a result of hitting pooling limits. - if string.contains("maximum concurrent instance limit") + if string.contains("maximum concurrent core instance limit") || string.contains("maximum concurrent memory limit") || string.contains("maximum concurrent table limit") { diff --git a/crates/jit/src/unwind/miri.rs b/crates/jit/src/unwind/miri.rs index 8e7113f7be40..4b4527e66834 100644 --- a/crates/jit/src/unwind/miri.rs +++ b/crates/jit/src/unwind/miri.rs @@ -3,7 +3,7 @@ use anyhow::Result; pub struct UnwindRegistration {} impl UnwindRegistration { - pub const SECTION_NAME: &str = ".eh_frame"; + pub const SECTION_NAME: &'static str = ".eh_frame"; pub unsafe fn new( _base_address: *const u8, diff --git a/crates/jit/src/unwind/systemv.rs b/crates/jit/src/unwind/systemv.rs index 66ba66f2c74a..2233e4dcb350 100644 --- a/crates/jit/src/unwind/systemv.rs +++ b/crates/jit/src/unwind/systemv.rs @@ -14,7 +14,7 @@ extern "C" { } impl UnwindRegistration { - pub const SECTION_NAME: &str = ".eh_frame"; + pub const SECTION_NAME: &'static str = ".eh_frame"; /// Registers precompiled unwinding information with the system. /// diff --git a/crates/jit/src/unwind/winx64.rs b/crates/jit/src/unwind/winx64.rs index f0f663077d1c..6468b87c3ec4 100644 --- a/crates/jit/src/unwind/winx64.rs +++ b/crates/jit/src/unwind/winx64.rs @@ -10,7 +10,7 @@ pub struct UnwindRegistration { } impl UnwindRegistration { - pub const SECTION_NAME: &str = ".pdata"; + pub const SECTION_NAME: &'static str = ".pdata"; pub unsafe fn new( base_address: *const u8, diff --git a/fuzz/fuzz_targets/instantiate-many.rs b/fuzz/fuzz_targets/instantiate-many.rs index 0a8fd9c92b6b..48f1248a181d 100644 --- a/fuzz/fuzz_targets/instantiate-many.rs +++ b/fuzz/fuzz_targets/instantiate-many.rs @@ -12,7 +12,7 @@ const MAX_MODULES: usize = 5; fuzz_target!(|data: &[u8]| { // errors in `run` have to do with not enough input in `data`, which we // ignore here since it doesn't affect how we'd like to fuzz. - drop(execute_one(data)); + let _ = execute_one(data); }); fn execute_one(data: &[u8]) -> Result<()> {