bytecodealliance / bytecodealliance/wasmtime
Wasmtime is too eager to use C++ name demangling
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
Given an input module that looks like:
```wasm
(module
(func $f unreachable)
(start $f)
)
```
this will print out:
```
$ wasmtime run foo.wat
Error: failed to run main module `foo.wat`
Caused by:
0: failed to instantiate "foo.wat"
1: wasm trap: wasm `unreachable` instruction executed
wasm backtrace:
0: 0x1a - !float
```
Here the function name `float` is incorrect in the backtrace. The reason this is due to [this automatic demangling](https://github.com/bytecodealliance/wasmtime/blob/ca106e9bcd97511e75a935f07d085982b7267be1/crates/jit/src/demangling.rs#L9-L10).
@fitzgen is there perhaps a different way we should invoke `cpp_demangle` to try to only trigger on C++ symbols? (e.g. the Rust `_Z` prefix or similar)
Contributor guide
Assessment
This issue has not been assessed yet.