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

WebAssembly uncaught abort #6255

Closed
buu700 opened this issue Feb 16, 2018 · 1 comment · Fixed by #8558
Closed

WebAssembly uncaught abort #6255

buu700 opened this issue Feb 16, 2018 · 1 comment · Fixed by #8558

Comments

@buu700
Copy link
Contributor

buu700 commented Feb 16, 2018

Original comment. Moving here as per @kripken's reply because the root cause is unrelated to that issue thread.

tl;dr: libsodium.js first tries to run a WebAssembly build of libsodium, and using Module.onAbort it detects when this fails and falls back to an asm.js build. This works as expected, but in the case of an asynchronous failure (in this case WebAssembly.instantiate failing, as opposed to e.g. window.WebAssembly not existing), it causes an error message to be logged to the console.

My best guess at the root cause was that after firing onAbort, abort goes on to throw an error.

If changing this is worthwhile, what I would expect to happen is for runtime errors to be handled somewhere whenever onAbort is defined, and/or maybe have a different onError handler that catches all failures and passes along the error object. Alternatively, maybe the problem can be fixed while only touching the code that calls WebAssembly.instantiate.

I might able to investigate in more depth and try to fix the issue myself in a few weeks, but if you don't mind submitting a PR, @ffflorian, I would start by looking at the abort function in src/postamble.js and the call to WebAssembly.instantiate in src/preamble.js.

@bas-d
Copy link
Contributor

bas-d commented May 28, 2019

Sorry to ruin the party but my PR didn't actually fix this issue, but ended up just being a refactor. I think the cleanest way to solve this is following @buu700's suggestion to add an onError to Module that return before the error is being thrown. See #8688.

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 a pull request may close this issue.

2 participants