bytecodealliance / bytecodealliance/wasmtime
Invalid UTF-8 was detected in one or more arguments
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
Running a WASM file with a binary argument, such as:
```
wasmtime run hmac_md5 --key `printf "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"` "String to hash"
```
or
```
wasmtime run hmac_md5 -- --key `printf "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"` "String to hash"
```
Aborts execution with the following error:
```
error: Invalid UTF-8 was detected in one or more arguments
```
I see three problems with this:
1. There is no standard I'm aware of that requires the arguments to be textual
2. There is no standard that requires them to be UTF-8 encoded
3. Wasmtime is doing unneeded work while validating the arguments, and/or converting them to UTF-8
Contributor guide
Assessment
This issue has not been assessed yet.