-
Notifications
You must be signed in to change notification settings - Fork 7
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
Initialization failure on Firefox #31
Comments
Could be related to a detached ArrayBuffer. It seems the rules are different for FF. I'll investigate. |
Another hint, if I halve the size of the dictionary, then it seems to crash less often. |
Conditionally creating a new this.writeBuffer = new Uint8Array(memory.buffer, 0, memory.buffer.byteLength); I imagine the problem will go away but the write speed will be atrocious. |
related to #30 |
Could it somehow be conditionally set for Firefox? It may be acceptable to have worse performance on Firefox as a trade-off for not crashing. |
I tried your fix locally but still saw the errors in Firefox. Did I miss anything? Was there something else to change? |
I did some digging and was able to move past the The |
Can't it be swapped out for See bjorn3's comment in : |
Tried that already of course. Same result. |
Looks like this is a FF issue and has to do with This will be tricky since the implication is that statics are not available in FF. The reason I've chosen to use them is because parsing the dictionary is quite slow on the JS side and it doesn't make sense to create a new instance of I'm leaving this open and asking for help. I'm sure theres a fix but it's eluding me atm. |
I know it's not a compile-time error, but I'll leave this here on the odd chance that it helps : https://users.rust-lang.org/t/static-allocation-for-webassembly-with-refcell/14420/3 |
Does transmute really need to be used here? There might be an alternative : https://doc.rust-lang.org/nomicon/transmutes.html If it does, it seems that it should probably be qualified as it is here as to reduce UB : |
Firefox 75, using the provided en-US dictionary. Works fine in Chrome.
When initializing, we get this error :
RangeError: "attempting to construct out-of-bounds TypedArray on ArrayBuffer"
This happens in the writeToBuffer call in index.js
I seem to get better results if I set the initial WebAssembly memory to 1000 pages instead of 1, but it still crashes. With devtools open, it seems to crash less.
The text was updated successfully, but these errors were encountered: