From 2f48c890a86e0e67a5c4c6d02624f28ebba1200a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 2 Mar 2022 13:34:04 -0600 Subject: [PATCH] Fix failing fuzzers with too-small instance sizes (#3873) The recent removal of `ModuleLimits` meant that the update to the fuzzers could quickly fail where the instance size limit was set to something small (like 0) and then nothing would succeed in compilation. This allows the modules to fail to compile and then continues to the next fuzz input in these situations. --- crates/fuzzing/src/oracles.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/fuzzing/src/oracles.rs b/crates/fuzzing/src/oracles.rs index 85c6b3c60e..d2e0404954 100644 --- a/crates/fuzzing/src/oracles.rs +++ b/crates/fuzzing/src/oracles.rs @@ -260,6 +260,15 @@ fn compile_module( if string.contains("minimum element size") { return None; } + + // Allow modules-failing-to-compile which exceed the requested + // size for each instance. This is something that is difficult + // to control and ensure it always suceeds, so we simply have a + // "random" instance size limit and if a module doesn't fit we + // move on to the next fuzz input. + if string.contains("instance allocation for this module requires") { + return None; + } } panic!("failed to compile module: {:?}", e);