Skip to content

Commit cff811b

Browse files
authored
Allow GC heap OOMs in wasmtime_fuzzing::oracles::unwrap_instance (#10615)
These errors are expected to crop up for some fuzz inputs and are not evidence of a bug in Wasmtime.
1 parent f3e5c87 commit cff811b

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

crates/fuzzing/src/oracles.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,15 @@ fn unwrap_instance(
409409
return None;
410410
}
411411

412-
// Allow traps which can happen normally with `unreachable` or a
413-
// timeout or such
414-
if e.is::<Trap>() {
412+
// Allow traps which can happen normally with `unreachable` or a timeout or
413+
// such.
414+
if e.is::<Trap>()
415+
// Also allow failures to instantiate as a result of hitting pooling
416+
// limits.
417+
|| e.is::<wasmtime::PoolConcurrencyLimitError>()
418+
// And GC heap OOMs.
419+
|| e.is::<wasmtime::GcHeapOutOfMemory<()>>()
420+
{
415421
return None;
416422
}
417423

@@ -424,11 +430,6 @@ fn unwrap_instance(
424430
return None;
425431
}
426432

427-
// Also allow failures to instantiate as a result of hitting pooling limits.
428-
if e.is::<wasmtime::PoolConcurrencyLimitError>() {
429-
return None;
430-
}
431-
432433
// Everything else should be a bug in the fuzzer or a bug in wasmtime
433434
panic!("failed to instantiate: {e:?}");
434435
}

0 commit comments

Comments
 (0)