-
Notifications
You must be signed in to change notification settings - Fork 627
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_func_call uses the wrong exec_env when multithreaded, gives "invalid exec env" #2172
Comments
cpetig
added a commit
to cpetig/wasm-micro-runtime
that referenced
this issue
May 3, 2023
cpetig
added a commit
to cpetig/wasm-micro-runtime
that referenced
this issue
May 3, 2023
Testcase (adapted from samples/wasm-c-api-imports) |
This was referenced May 3, 2023
wenyongh
pushed a commit
that referenced
this issue
May 5, 2023
Fix issue reported in #2172: wasm-c-api `wasm_func_call` may use a wrong exec_env when multi-threading is enabled, with error "invalid exec env" reported Fix issue reported in #2149: main instance's `c_api_func_imports` are not passed to the counterpart of new thread's instance in wasi-threads mode Fix issue of invalid size calculated to copy `c_api_func_imports` in pthread mode And refactor the code to use `wasm_cluster_dup_c_api_imports` to copy the `c_api_func_imports` to new thread for wasi-threads mode and pthread mode.
Fixed by above MR. I found that the C API is unsuitable for multi-threaded host implementations, and much less ergonomic than the native API. |
victoryang00
pushed a commit
to victoryang00/wamr-aot-gc-checkpoint-restore
that referenced
this issue
May 27, 2024
…ance#2173) Fix issue reported in bytecodealliance#2172: wasm-c-api `wasm_func_call` may use a wrong exec_env when multi-threading is enabled, with error "invalid exec env" reported Fix issue reported in bytecodealliance#2149: main instance's `c_api_func_imports` are not passed to the counterpart of new thread's instance in wasi-threads mode Fix issue of invalid size calculated to copy `c_api_func_imports` in pthread mode And refactor the code to use `wasm_cluster_dup_c_api_imports` to copy the `c_api_func_imports` to new thread for wasi-threads mode and pthread mode.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you call wasm_func_call from a callback which executes on a separate thread you get "invalid exec env" exception.
The check in wasm_runtime.c:2398 fails.
The text was updated successfully, but these errors were encountered: