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

WASM module (attached) that works in browsers throws an error from dotnet-webassembly #62

Open
ThunderousEcho opened this issue Mar 3, 2023 · 4 comments

Comments

@ThunderousEcho
Copy link

ThunderousEcho commented Mar 3, 2023

Error from dotnet-webassembly:
ModuleLoadException: At offset 525: Unrecognized section type 12. WebAssembly.Runtime.Compile.FromBinary (WebAssembly.Reader reader, WebAssembly.Runtime.CompilerConfiguration configuration, System.Type instanceContainer, System.Type exportContainer) (at /_/WebAssembly/Runtime/Compile.cs:505) WebAssembly.Runtime.Compile.FromBinary[TExports] (System.IO.Stream input, WebAssembly.Runtime.CompilerConfiguration configuration) (at /_/WebAssembly/Runtime/Compile.cs:105) WebAssembly.Runtime.Compile.FromBinary[TExports] (System.IO.Stream input) (at /_/WebAssembly/Runtime/Compile.cs:83)
non-working in dotnet-webassembly.zip

Note that I'm running this from inside Unity
dotnet-webassembly version 1.2.1
WASM module generated with tinygo

Thanks in advance for any help

@RyanLamansky
Copy link
Owner

Whatever "section type 12" is, it must be a relatively recent addition to the WASM spec. I'll look into this when I have time.

@chutchinson
Copy link

Looks like this library doesn't implement the Bulk Memory Operations proposal, which introduces section 12 as an optional section that describes the number of data segments in the module: https://github.com/WebAssembly/bulk-memory-operations/blob/master/proposals/bulk-memory-operations/Overview.md

@RyanLamansky
Copy link
Owner

I spent some time on this today and although adding support for the DataCount section is easy, it's only the first problem: your WASM also uses new instructions. Those will need to be implemented, too, for compilation to work.

@ThunderousEcho
Copy link
Author

Thanks for looking into this

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

3 participants