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

通过AssemblyScript编译的wasm调用本地函数时wasm_runtime_spawn_exec_env返回0,失败了 #4027

Open
kamylee opened this issue Jan 16, 2025 · 1 comment

Comments

@kamylee
Copy link

kamylee commented Jan 16, 2025

使用cmake和wasi sdk编译cpp生成的wasm应用加载到wamr中运行。并调用本地函数NativeApiMosquittoInit(),由于mosquitto的回调函数on_message是由mosquitto自己内部创建的子线程调用的。所以我需要创建一个新的g_new_exec_env 。执行g_new_exec_env = wasm_runtime_spawn_exec_env(exec_env); 是成功的(返回非0 值)其他功能都正常。

但是通过AssemblyScript编译由TypeScrite编写生成的wasm中调用本地函数NativeApiMosquittoInit(),其中执行g_new_exec_env = wasm_runtime_spawn_exec_env(exec_env);却返回0,我需要在AssemblyScript编译时设置些什么呢?或都是哪里弄得不对?
求解答!感谢!

@kamylee
Copy link
Author

kamylee commented Jan 16, 2025

我是我的测试相关内容:
Image

Image

Image

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

No branches or pull requests

1 participant