New issue
Advanced search Search tips

Issue 736602 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

WebAssembly + Worker crash on Android

Reported by ryan@cyph.com, Jun 24 2017

Issue description

Steps to reproduce the problem:
Open https://beta.cyph.ws in Chrome on Android (confirmed on 4.4, 5, 6, 7.0, and 7.1)

What is the expected behavior?
Page should function normally

What went wrong?
Page consistently crashes as soon as it's fully loaded

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 58.0.3029.83  Channel: stable
OS Version: 7.0.0
Flash Version: 

This is only reproducible in mobile Chrome — not desktop Chrome, desktop Firefox, or mobile Firefox.

Whet the crash occurs, the following WebAssembly libraries are being loaded inside a blob URL Worker:

* https://github.com/cyph/mceliece.js

* https://github.com/cyph/ntru.js

* https://github.com/cyph/rlwe.js

* https://github.com/cyph/supersphincs

While the problem occurs in beta.cyph.ws (a prod-like build configuration), the same code deployed in a more basic configuration at https://simple-beta-dot-cyph-ws-dot-cyphme.appspot.com works as expected.

Potentially relevant differences between the prod/prod-like and simple environments:

* Prod uses the Angular CLI prod build configuration (AOT compilation, etc.); simple uses non-prod/JIT

* Prod uses the Content Security Policy at https://github.com/cyph/cyph/blob/master/shared/csp; simple has none

* Prod creates the Worker with the full contents of each of those libraries included inline; simple imports them as a remote webpack bundle using importScripts

As far as a reduced test case, I can play around with this early next week and try to better isolate the problem.
 

Comment 1 by ryan@cyph.com, Jun 24 2017

Also, all of those libraries use the asynchronous WebAssembly.instantiate API (via emscripten).

Comment 2 by ryan@cyph.com, Jun 25 2017

Two updates:

1. simple-beta actually does seem to be affected now, so you can probably disregard that list of differences between the environments. I'm not sure why it appeared unaffected when I tested earlier.

2. Turns out the issue is a lot simpler than I'd expected (nothing to do with Workers at all). Here's a reduced test case: <html><body><script src='https://rawgit.com/cyph/mceliece.js/f106c79/dist/mceliece.js'></script></body></html>

It's just that one particular library that's causing this; the others listed all work fine.

Comment 3 by ryan@cyph.com, Jun 26 2017

Forgot to add earlier: a workaround has been implemented in the latest mceliece.js (forcing mobile Chrome to use the asm.js fallback) and deployed to beta.cyph.ws, so for testing you'll need to use the reduced test case, not my original test steps. Here's a Codepen of the test: https://codepen.io/anon/pen/WOZVRy

Comment 4 by jochen@chromium.org, Jun 27 2017

Components: -Blink>JavaScript Blink>JavaScript>WebAssembly
Owner: mtrofin@chromium.org
Status: Assigned (was: Unconfirmed)
Owner: ahaas@chromium.org
Andreas, this may be related to the isolate shutdown stuff you've recently fixed - could you confirm? Thanks!

Comment 6 by ahaas@chromium.org, Jun 30 2017

Mircea, were you able to reproduce this issue? https://codepen.io/anon/pen/WOZVRy does not crash for me on Chrome 59 and higher, neither on Android nor on Linux. A local arm build of Chrome 58 did also not crash for me.

Comment 7 by ryan@cyph.com, Jun 30 2017

Awesome. I can still reproduce it on Android Chrome in BrowserStack, but it's no longer reproducible on my phone after updating to Chrome 59.
Status: Fixed (was: Assigned)

Sign in to add a comment