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

Asyncify: fix abort() handling #9000

Merged
merged 6 commits into from
Jul 16, 2019
Merged

Asyncify: fix abort() handling #9000

merged 6 commits into from
Jul 16, 2019

Conversation

kripken
Copy link
Member

@kripken kripken commented Jul 16, 2019

Asyncify wasm error handling leads to unreachables being thrown. This PR maps those errors into calls to abort(), which ensures the runtime is properly shut down if they occur. In particular, no more code will be run, which could previously be confusing while debugging.

@kripken kripken requested a review from sbc100 July 16, 2019 19:45
@sbc100
Copy link
Collaborator

sbc100 commented Jul 16, 2019

"Asyncify wasm error handling leads to unreachables being thrown."

Why? Could the Asyncify implementation call abort() instead, or is this intrinsic the way its implemented?

@kripken
Copy link
Member Author

kripken commented Jul 16, 2019

I should have given more background, yeah. Asyncify is designed as a standalone binaryen pass - it knows nothing about emscripten. You can run it on arbitrary wasm. So it uses the universal unreachable error mechanism.

We could add an "emscripten" mode to it, but I preferred to keep the emscripten-specific details here in emscripten.

@kripken kripken merged commit 14c60fa into incoming Jul 16, 2019
@kripken kripken deleted the bybort branch July 16, 2019 20:22
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
Asyncify wasm error handling leads to unreachables being thrown. This PR maps those errors into calls to abort(), which ensures the runtime is properly shut down if they occur. In particular, no more code will be run, which could previously be confusing while debugging.

Background: Asyncify is designed as a standalone binaryen pass - it knows nothing about emscripten. You can run it on arbitrary wasm. So it uses the universal unreachable error mechanism. (We could add an "emscripten" mode to it there, but I preferred to keep the emscripten-specific details here in emscripten.)
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

Successfully merging this pull request may close these issues.

2 participants