Add a limits and trap-on-OOM options to the CLI (#6149)

* Add a limits and trap-on-OOM options to the CLI

This commit adds new options to the `wasmtime` CLI to control the
`Store::limiter` behavior at runtime. This enables artificially
restriction the memory usage of the wasm instance, for example.
Additionally a new option is added to `StoreLimits` to force a trap on
growth failure. This is intended to help quickly debug modules with
backtraces if OOM is happening, or even diagnosing if OOM is happening
in the first place.

* Fix compile of fuzzing oracle
This commit is contained in:
Alex Crichton
2023-04-05 12:26:36 -05:00
committed by GitHub
parent 967543eb43
commit 52e90532e0
8 changed files with 310 additions and 83 deletions

View File

@@ -306,11 +306,16 @@ fn massive_64_bit_still_limited() -> Result<()> {
_current: usize,
_request: usize,
_max: Option<usize>,
) -> bool {
) -> Result<bool> {
self.hit = true;
true
Ok(true)
}
fn table_growing(&mut self, _current: u32, _request: u32, _max: Option<u32>) -> bool {
fn table_growing(
&mut self,
_current: u32,
_request: u32,
_max: Option<u32>,
) -> Result<bool> {
unreachable!()
}
}