-
Notifications
You must be signed in to change notification settings - Fork 173
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
run-native: assemblyscript hello world fails with 'WASM error: only one memory per module is supported ()' #740
Comments
fwiw, it seems wasm3-specifc as it doesn't happen with toywasm. #749 |
This was caused by wasm3 bug, the wasm3 runtime requires exactly one memory section: https://github.com/wasm3/wasm3/blob/main/source/m3_parse.c#L460, however, it's legal to have wasm declare 0 memory sections. The fix will be Or build |
It may be related to how the memory is imported, i.e. (import "env" "memory" (memory 1)) vs (memory (import "env" "memory") 1) The former one will fail due to the fact that @easeway mentioned: there will be no memory in memory section |
these two are exactly same. |
assemblyscript seems to produce an empty memory section, which makes wasm3 unhappy. other toolchains usually just omits the memory section if a module has no memory defined. wasm3 wrongly assumes this behavior. |
steps to reproduce:
w4 version 2.7.0
node version 20.1.0
output:
tested: the cart works in browser with
w4 run cart.wasm
.tested: if the cart is bundled for windows with
w4 bundle cart.wasm --windows cart.exe
then the exe produces the same error as before.tested: removing
"importMemory": true
in asconfig.json seems to fix the issue. is this flag needed?The text was updated successfully, but these errors were encountered: