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.
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.
Last updated: Dec 23 2024 at 13:07 UTC