-
Notifications
You must be signed in to change notification settings - Fork 639
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
WASI-SDK 25 call_indrect doesn't work on Darwin #3977
Comments
I think turning on reference types resolves this issue. This PR changes the default CMake file for Darwin to do this. #3978 It appeared to be turned on by default on the linux build at the moment, just not on Darwin. |
Hi @woodsmc I think it's reasonable to enable ref types by default. Having said that, I think we could do a better job in terms of error reporting and have clear message when iwasm was compiled with ref types disabled but the binary was compiled with ref types enabled. I can make the change once I'm back from holiday (January next year) so let's keep the issue open until the error handling is improved so I don't forget about it :) |
@loganek That's a great idea, if I get the chance over the holidays, I might try to add that concept to the PR - fir this specific case anyway. Or - are you thinking of something more compiler flags, error specific. - Generating a table of the compiled flag options, and using this to allow the WAMR runtime to report how it's compiled, and use the same structure to aid with error condition diagnosis and messaging to the user ? |
@woodsmc AFAIK we can get that information (whether ref types are being used in the wasm binary) from the type section - if that's detected, and WAMR was compiled with ref types disabled, we show an error and stop loading. |
Thanks for filing a bug or defect report! Please fill out the TODOs below.
Subject of the issue
WASI SDK 25 generates a call indirect which uses a ref type format. It doesn't parse correctly on the default build of iwasm for Darwin. Executing the generated wasm with the default iwasm for Darwin results in : ``WASM module load failed: zero byte expected`
Test case
Upload the related wasm file, wast file or the source files if you can.
Compile this with wasi-sdk-25 and attempt to execute with iwasm results in an error message - ``WASM module load failed: zero byte expected`
Your environment
Steps to reproduce
Tell us how to reproduce this bug or defect.
Build the code above with wasi-sdk-25, attempt to run with default iwasm on darwin. Receive error message as below
And the error message ``WASM module load failed: zero byte expected` is displayed.
Expected behavior
Tell us what should happen: The function should execute
Actual behavior
Tell us what happens instead: WAMR displays error message instead.
Extra Info
Anything else you'd like to add?
The text was updated successfully, but these errors were encountered: