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.
This commit is contained in:
Alex Crichton
2022-09-06 13:38:09 -05:00
committed by GitHub
parent 543a487939
commit a0e4bb0190

View File

@@ -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);