Bug 206328 - Safari's WebAssembly compiler runs out of memory when reloading figma.com
Summary: Safari's WebAssembly compiler runs out of memory when reloading figma.com
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebAssembly (show other bugs)
Version: Safari 13
Hardware: iPhone / iPad iOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-15 17:37 PST by evan.exe
Modified: 2022-02-11 14:18 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description evan.exe 2020-01-15 17:37:13 PST
I work at Figma, which is a browser-based interface design tool. We're interested in improving the experience of using Figma on an iPad. It's mostly going fine except that we've hit a major blocker: reloading Figma on iPad causes Safari to fail to compile our WebAssembly module.

Repro steps:

1. Obtain an iPad (ours is a iPad Pro 11 inch with iPadOS 13.3)
2. Sign up for an account on https://www.figma.com (it's free)
3. Create a new file by clicking on New File
4. When the editor has finished loading, click the reload button
5. If the editor loads successfully, click the reload button again

Within a few reloads, the Figma editor crashes. You can tell because the editor disappears and you see the error message "An error occurred while opening the editor."

The specific error that we're experiencing is "Out of executable memory in function at index N" where N is some number. Using that I have found these tickets so far:

* https://bugs.webkit.org/show_bug.cgi?id=200807 (resolved fixed)
* https://bugs.webkit.org/show_bug.cgi?id=200686 (duplicate of 200807)

It looks like these tickets are about Safari not being able to compile WebAssembly modules that are too big. However, I suspect our issue is different than those issues. Our app actually is able to compile and run successfully the first time, so it must not be true that the compiled WebAssembly module is larger than 128mb in size. Rather, perhaps there's some internal WebAssembly memory limit that isn't reset when a page navigation happens?

We'd very much like to recommend an iPad-based Figma workflow to our users, but we are unable to given that this issue causes Figma to crash frequently. Any idea if a fix for this issue is upcoming? Alternatively, are there things we can do on our end to work around these crashes?
Comment 1 Radar WebKit Bug Importer 2020-01-15 22:18:18 PST
<rdar://problem/58634086>