Skip to content

Catch OutOfMemoryError at WasmGC allocation sites - #149

Open
andreaTP wants to merge 2 commits into
bytecodealliance:mainfrom
andreaTP:catch-oom-wasmgc
Open

Catch OutOfMemoryError at WasmGC allocation sites#149
andreaTP wants to merge 2 commits into
bytecodealliance:mainfrom
andreaTP:catch-oom-wasmgc

Conversation

@andreaTP

Copy link
Copy Markdown
Contributor

Convert OutOfMemoryError to WasmEngineException("out of memory") in all GC allocation instructions (struct.new, struct.new_default, array.new, array.new_default, array.new_fixed, array.new_data, array.new_elem) across the interpreter, compiler runtime, and constant expression evaluator paths.

Follows the existing StackOverflowError precedent.

Refs: #102

Convert OutOfMemoryError to WasmEngineException("out of memory") in
all GC allocation instructions (struct.new, struct.new_default,
array.new, array.new_default, array.new_fixed, array.new_data,
array.new_elem) across the interpreter, compiler runtime, and
constant expression evaluator paths.

Follows the existing StackOverflowError precedent.

Refs: bytecodealliance#102
@andreaTP

Copy link
Copy Markdown
Contributor Author

@philip-segerfast if you can try your stress tests with those changes let me know the results.

The idea is that it shouldn't be possible to trigger a plain Java OOM from inside a Wasm module, we should identify the condition and report the caller with a specific Wasm Exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant