-
Notifications
You must be signed in to change notification settings - Fork 3.4k
ASYNCIFY, EXIT_RUNTIME and std::process::exit() #21474
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
Comments
Asyncify doesn't depend on EXIT_RUNTIME, AFAIK - most of our tests run without it actually. If it's calling |
All of my async library functions are completing. I am manually calling |
The Do you have some way to completely disable exceptions to verify this? The emscripten/tools/js_manipulation.py Lines 146 to 157 in 918e131
|
Yup, I can repro this locally by enabling exception catching can calling
|
The `stackRestore` function used by `invoke_xxx` wrappers and gets called as the stack unwinds after a call to `exit`. Alternatively we could add a check in each of the `invoke_xxx` wrappers to avoid calling `stackRestore`, but that doesn't seem worth it. Fixes: emscripten-core#21474
The `stackRestore` function used by `invoke_xxx` wrappers and gets called as the stack unwinds after a call to `exit`. Alternatively we could add a check in each of the `invoke_xxx` wrappers to avoid calling `stackRestore`, but that doesn't seem worth it. Fixes: emscripten-core#21474
I don't have exceptions enabled in my project (no But we did have exceptions problems last time, which were seemingly solved by switching to C++ linking (even though it's Rust, not C++): |
Yes, for whatever reason there is exception handling code being generated here. (either that or setjmp/longjmp). If it is exception handling then you might want to investigate to see if you can remove it since it does some at a cost. Specifically it looks like the code you call is being compiled explicitly either with |
The `stackRestore` function used by `invoke_xxx` wrappers and gets called as the stack unwinds after a call to `exit`. Alternatively we could add a check in each of the `invoke_xxx` wrappers to avoid calling `stackRestore`, but that doesn't seem worth it. Fixes: emscripten-core#21474
The `stackRestore` function used by `invoke_xxx` wrappers and gets called as the stack unwinds after a call to `exit`. Alternatively we could add a check in each of the `invoke_xxx` wrappers to avoid calling `stackRestore`, but that doesn't seem worth it. Fixes: #21474
Manually replacing the
Neither of those are explicitly set. Perhaps Honestly, this is beyond me! Performance is already somewhat poor with ASYNCIFY. I'm just happy to have a working solution. 🙂 |
I've always compiled my project with both ASYNCIFY and EXIT_RUNTIME, but now that I'm mixing some Rust into it, it's not working as smoothly as before.
After my program has exited, by calling
std::process::exit(0)
, it now raises these errors:If I instead disable EXIT_RUNTIME, well now it seems to never actually resume after the first async import is called. Maybe that was always the case - does ASYNCIFY require EXIT_RUNTIME?
I'm not sure why it's trying to call
doRewind
after it's exited...Asyncify.state
is 0.Is Rust's
std::process::exit()
not really compatible with Emscripten, or ASYNCIFY? The equivalent code in my old C library was justexit(0)
.The text was updated successfully, but these errors were encountered: