-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
Intermittent crash using ThreadRng::gen() in webkit based browser with wasm-bindgen #1016
Comments
Perhaps it's a problem in this crate? https://github.com/cryptocorrosion/cryptocorrosion/blob/master/utils-simd/ppv-lite86/src/generic.rs#L106 Should the |
|
Reading the code tells me that Perhaps WASM doesn't handle the Can you try adding |
@dhardy I bet this is it. The behavior of this union is well-defined (size should be same as |
Using |
Not surprising. Nevertheless, relying on that is relying on UB (from my understanding), so we ought to fix it. That leaves a WASM bug? |
I don't see how this would be the case. If I were transmuting the union itself, I would agree that
Since the error occurs when initializing the union, and there's no wrong way to do that, I think it has to be a WASM bug. But we'll probably want a workaround for users of toolchains older than whenever a fix comes out. I'll fix |
No, and the docs are quite explicit:
It's not the only use-case: the other one is untagged enums. |
I don't think it's possible for the compiler to use any but the obvious layout for this union without violating the documented properties of |
Hm, removing the u128 member from the union didn't solve the problem. It must have only seemed to fix it because the crash is non-deterministic and perturbing the compilation resulted in a different outcome. With u128 (and repr) issues ruled out, I can't see why instantiating this simple union would crash. Currently combing through the WASM disassembly in the backtrace. |
Actually, I think after that change I'm hitting a different problem. It's not a bad memory access now, it's entering an abort branch when a read from memory returns 1. It fits the pattern of something like a mutex acquisition failure, so I'm wondering if it has to do with the way the ThreadRng synchronization code is compiling to the single-threaded wasm environment. I haven't been able to get function names or any other source map info in firefox, which would make things clearer. I'll try it under webkit2gtk. |
What are these? |
There isn't any as such, but there is a |
Every day I'm thinking that it's more and more likely that this is a problem specific to libwebkit2gtk (some bug in their wasm implementation) and this issue can probably be closed. |
Since we have adjusted |
I've not had the time to create a reproducible example that I can share, this issue appears to be exclusively occurring on libwebkit2gtk, perhaps it's a bug with the webassembly implementation there. After several weeks running my application in chomium and firefox I've yet to reproduce the issue in those browsers. I've also had some rendering issues exclusive to libwebkit2gtk so probably will ditch it at this point and use some other solution. |
Common issues
I'm getting an intermittent
Unhandled Promise Rejection
crash with my code compiled using wasm-bindgen, viawasm-pack
using theweb
target, and the--dev
profile. This code is running in thewebkit2gtk 2.28.4-1
browser on Archlinux.I'm using
rand
version0.7.3
and thewasm-bindgen
feature enabled.The line of code that is triggering this error is:
The backtrace for the error within
rand
:The text was updated successfully, but these errors were encountered: