Stream: git-wasmtime

Topic: wasmtime / Issue #1250 Allow reporting errors when loadin...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 07 2020 at 01:39):

cgranade opened Issue #1250:

<!-- Please try to describe precisely what you would like to do in
Cranelift/Wasmtime and/or expect from it. You can answer the questions below if
they're relevant and delete this text before submitting. Thanks for opening an
issue! -->

Feature

When loading wasm modules into .NET with wasmtime, an exception is raised if a module is invalid. This exception doesn't provide any details as to what went wrong, however, making it hard to fix the module.

Implementation

The .NET implementation relies on the wasm_module_new function.
https://github.com/bytecodealliance/wasmtime/blob/121bbd36568c506a39b2dd97a95dd2b963960eb7/crates/c-api/src/lib.rs#L828

This function currently discards the error information with a match expression:

https://github.com/bytecodealliance/wasmtime/blob/121bbd36568c506a39b2dd97a95dd2b963960eb7/crates/c-api/src/lib.rs#L836

Allowing this information to be captured in a callback or in a mutable pointer to a string that could capture the Debug derive for the anyhow::Error would be helpful in diagnosing errors that occur when loading modules.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 07 2020 at 00:01):

peterhuene transferred Issue #1250:

<!-- Please try to describe precisely what you would like to do in
Cranelift/Wasmtime and/or expect from it. You can answer the questions below if
they're relevant and delete this text before submitting. Thanks for opening an
issue! -->

Feature

When loading wasm modules into .NET with wasmtime, an exception is raised if a module is invalid. This exception doesn't provide any details as to what went wrong, however, making it hard to fix the module.

Implementation

The .NET implementation relies on the wasm_module_new function.
https://github.com/bytecodealliance/wasmtime/blob/121bbd36568c506a39b2dd97a95dd2b963960eb7/crates/c-api/src/lib.rs#L828

This function currently discards the error information with a match expression:

https://github.com/bytecodealliance/wasmtime/blob/121bbd36568c506a39b2dd97a95dd2b963960eb7/crates/c-api/src/lib.rs#L836

Allowing this information to be captured in a callback or in a mutable pointer to a string that could capture the Debug derive for the anyhow::Error would be helpful in diagnosing errors that occur when loading modules.


Last updated: Nov 22 2024 at 17:03 UTC