Stream: git-wasmtime

Topic: wasmtime / issue #3705 Display expected/actual type signa...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 20 2022 at 19:39):

TerrorJack opened issue #3705:

Feature

Currently, when a call_indirect opcode is executed with mismatching types, wasmtime would display something like:

Error: failed to run main module `closure.wasm`

Caused by:
    0: failed to invoke command default
    1: wasm trap: indirect call type mismatch
       wasm backtrace:
           0: 0x40515a - <unknown>!__main_void
           1: 0x4051af - <unknown>!__original_main
           2: 0x405197 - <unknown>!_start
           3: 0x4078c8 - <unknown>!_start.command_export

It would be nice to have enriched error message that displays the expected/actual type signatures here, this will help debugging a lot.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 20 2022 at 20:57):

bjorn3 commented on issue #3705:

This would be nice to have IMHO. It doesn't seem like there is an obvious way to pass the id of the actual and expected signature back to the wasmtime runtime. The trap is raised using a hardware trap instruction like ud2. This doesn't allow any arguments. Using a call instead would be possible though I suspect it will cause a perf regression, but I will leave it to others to judge as I am not familiar with this part of the code.

https://github.com/bytecodealliance/wasmtime/blob/1532516a363eed88b5a36726a1710411a9883049/crates/cranelift/src/func_environ.rs#L1378


Last updated: Oct 23 2024 at 20:03 UTC