Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown miscellaneous opcode 10 (0x0a) #63

Open
chutchinson opened this issue Apr 19, 2023 · 2 comments
Open

Unknown miscellaneous opcode 10 (0x0a) #63

chutchinson opened this issue Apr 19, 2023 · 2 comments

Comments

@chutchinson
Copy link

I wrote a trivial hello world program in Rust and then compiled using the wasm32-wasi target. I am working on a WASI implementation and have implemented enough of the WASI spec to execute this Rust program; however, the parser fails while reading the binary module:

WebAssembly.ModuleLoadException: At offset 12463: At offset 12462: Don't know how to parse miscellaneous opcode "10".

I understand that opcode 0x0a is not implemented by the spec (perhaps in a proposal?); so this makes me think either that the module parser has a bug, or the Rust compiler is generating WASM32 code that is not covered by this software.

The Rust program is simply:

fn main() {
    println!("hello world");
}
cargo build --release --target wasm32-wasi

The WAT representation of the module is attached.

sample.txt

I am interested in contributing to this library. It would be awesome to have a WebAssembly runtime native to .NET that leveraged RyuJIT (x86, x64, amd32, amd64). Any guidance on what this issue could be would be a good starting point.

@chutchinson
Copy link
Author

So, after diving into the source code and the WASM spec, this error is referring to the Bulk Memory Operations proposal. After implementing these instructions I can load the module. Section 12 (Data Count) is also part of that proposal.

@RyanLamansky
Copy link
Owner

That makes sense--I haven't been keeping up with all the add-ons after the original 1.0 spec 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants