From a0e4bb0190de91395d1ec95a5a51fa6b220f1758 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 6 Sep 2022 13:38:09 -0500 Subject: [PATCH] Prevent virtual memory OOM in spectest fuzzing (#4872) This commit hard-codes the pooling allocator's limit of linear memories to 1 when used with fuzzing the spec tests themselves. This prevents the number from being set too high and hitting a virtual-memory-based OOM due to the virtual memory reservation of the pooling allocator being too large. --- crates/fuzzing/src/generators/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fuzzing/src/generators/config.rs b/crates/fuzzing/src/generators/config.rs index 6da42fb786..bbea237c3a 100644 --- a/crates/fuzzing/src/generators/config.rs +++ b/crates/fuzzing/src/generators/config.rs @@ -131,7 +131,7 @@ impl Config { // required to actually run the spec tests. Fuzz-generated inputs // may have limits less than these thresholds which would cause the // spec tests to fail which isn't particularly interesting. - limits.memories = limits.memories.max(1); + limits.memories = 1; limits.tables = limits.memories.max(5); limits.table_elements = limits.memories.max(1_000); limits.memory_pages = limits.memory_pages.max(900);