-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
RuntimeError: unreachable when calling imported function in standalone mode #12322
Comments
I think we figured this out on discord. proc_exit is supposed to never return. You need to I think llvm inserts and emscripten/system/include/wasi/api.h Line 2604 in 0014175
|
codefromthecrypt
pushed a commit
to tetratelabs/wazero
that referenced
this issue
Jul 5, 2022
This changes the AssemblyScript abort handler and WASI proc_exit implementation to panic the caller which eventually invoked close. This ensures no code executes afterwards, For example, LLVM inserts unreachable instructions after calls to exit. See emscripten-core/emscripten#12322 See #601 Signed-off-by: Adrian Cole <adrian@tetrate.io>
codefromthecrypt
pushed a commit
to tetratelabs/wazero
that referenced
this issue
Jul 6, 2022
This changes the AssemblyScript abort handler and WASI proc_exit implementation to panic the caller which eventually invoked close. This ensures no code executes afterwards, For example, LLVM inserts unreachable instructions after calls to exit. See emscripten-core/emscripten#12322 See #601 Signed-off-by: Adrian Cole <adrian@tetrate.io>
codefromthecrypt
pushed a commit
to tetratelabs/wazero
that referenced
this issue
Jul 6, 2022
This changes the AssemblyScript abort handler and WASI proc_exit implementation to panic the caller which eventually invoked close. This ensures no code executes afterwards, For example, LLVM inserts unreachable instructions after calls to exit. See emscripten-core/emscripten#12322 See #601 Signed-off-by: Adrian Cole <adrian@tetrate.io>
codefromthecrypt
added a commit
to tetratelabs/wazero
that referenced
this issue
Jul 6, 2022
This changes the AssemblyScript abort handler and WASI proc_exit implementation to panic the caller which eventually invoked close. This ensures no code executes afterwards, For example, LLVM inserts unreachable instructions after calls to exit. See emscripten-core/emscripten#12322 See #601 Signed-off-by: Adrian Cole <adrian@tetrate.io>
codefromthecrypt
added a commit
to tetratelabs/wabin
that referenced
this issue
Aug 30, 2022
This changes the AssemblyScript abort handler and WASI proc_exit implementation to panic the caller which eventually invoked close. This ensures no code executes afterwards, For example, LLVM inserts unreachable instructions after calls to exit. See emscripten-core/emscripten#12322 See #601 Signed-off-by: Adrian Cole <adrian@tetrate.io>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When importing a JS function from C & calling it in standalone mode, I get an unreachable error (WASM execution hit an "unreachable" statement).
Here's the reproduction:
The command:
emcc sample.c -o sample.wasm -s ERROR_ON_UNDEFINED_SYMBOLS=0
.Emscripten version: emcc (Emscripten gcc/clang-like replacement) 2.0.4 (3047b77)
The text was updated successfully, but these errors were encountered: