Bug 256023

Summary: Out of memory error of generating WebAssembly.Memory in AudioWorklet Processor after reloading many times
Product: WebKit Reporter: tamaru
Component: WebAssemblyAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: alex, cdumez, ivan.curic, mark.lam, tamaru, webkit-bug-importer, webkit, ysuzuki
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: iPhone / iPad   
OS: iOS 16   
See Also: https://bugs.webkit.org/show_bug.cgi?id=272813
Attachments:
Description Flags
Source code of the demo page none

tamaru
Reported 2023-04-26 19:51:11 PDT
Created attachment 466113 [details] Source code of the demo page Steps to produce: 1. Create a web page: 1.1. Create an AudioContext and an AudioWorklet. 1.2. Create a 256MB (to be precise, 268435456 bytes) WebAssembly.Memory in the AudioWorkletProcessor. 2. Open the page in iOS Safari or iOS Chrome. 3. Reload the page many (7) times. -> On the 7th reload (8th opening), the WebAssembly.Memory cannot be created due to an "Out of memory" error. Notes: - Opening the page in another tab does not cause the issue. - Just referring to the buffer of the WebAssembly.Memory also prevents the issue, but I do not know why. - Closing the AudioContext and assigning null to the WebAssembly.Memory did not solve the issue. Demo page: https://wasm-memory-in-audioworklet-test.netlify.app/ By selecting "OK" of the confirmation dialog, the buffer of the WebAssembly.Memory will be referred to, resulting in no error. By selecting "Cancel" of the confirmation dialog, the buffer of the WebAssembly.Memory will not be referred to, resulting in the error on the 7th reload. The source code is attached. I tested on iPadOS 16.4.1, iPad Air 5th gen.
Attachments
Source code of the demo page (1.99 KB, application/x-zip-compressed)
2023-04-26 19:51 PDT, tamaru
no flags
Radar WebKit Bug Importer
Comment 1 2023-05-03 19:52:20 PDT
goldwaving
Comment 2 2023-12-18 07:43:58 PST
Just a few reloads of our audio editing app (https://goldwave.com/editor) fails on Safari version 17.2 with a memory range error, but Firefox and Chrome work fine (on non-iOS devices). The error continues for every reload until Safari is terminated.
Ivan Čurić
Comment 3 2024-01-31 04:50:22 PST
Alex Suzuki
Comment 4 2024-06-18 01:09:14 PDT
This is the same issue as https://bugs.webkit.org/show_bug.cgi?id=222097 and should be marked as duplicate. This bug is causing problems in production for customers of our barcode scanning library STRICH (https://strich.io). It is especially annoying as reloading the page will not fix the issue, and this is definitely not something users are accustomed to.
tamaru
Comment 5 2024-09-16 17:53:51 PDT
In iPadOS 18.0, using the demo at https://wasm-memory-in-audioworklet-test.netlify.app/, the behavior has changed: 1. The "Out of memory" error now occurs on approximately the 17th reload (18th opening). The number of reloads before the error varies slightly between attempts. 2. The previous workaround, where referring to the WebAssembly.Memory buffer by selecting "OK" in the confirmation dialog avoided the error, no longer works.
Note You need to log in before you can comment on or make changes to this bug.