-
Notifications
You must be signed in to change notification settings - Fork 588
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
Error occurs when calling native function with local variable in AOT mode? #3345
Comments
Do you have a minimal reproducible example? Maybe I can give it a try to see where went wrong |
generate wasm: generate aot: code in test.c:
}`
|
From you snapshot, I think maybe it's a platform specific question on windows, I tested it on ubuntu 20.04, it seems no error appears with foo2 implemented as following: static void
foo2_wrapper(wasm_exec_env_t exec_env, char *name, char *result, int resultlen)
{
strncpy(result, name, resultlen);
}
static NativeSymbol native_symbols[] = {
REG_NATIVE_FUNC(foo2, "($*~)")
}; I will try it on Windows to see where went wrong |
I also tried it in Ubuntu 22.04 and it ran okay with local variables. it seems to be a specific error on the Windows platform. thank you! wait for your conclusion! |
Hi, could you please tell me whether you compiled the iwasm and wamrc with the latest commit? I didn't see similar error on Windows |
Can you try with the latest commit and recompile both the iwasm and wamrc to see whether the error is still? |
thank you very much,It's running ok after the update. :) |
When I call a native function and pass a local variable, it runs fine in wasm mode. But when I compile it into an AOT file, it crashes when executing wasm_runtime_load. If I use a global variable, it runs fine. Do I need to set something when compiling into an AOT file?
The text was updated successfully, but these errors were encountered: