WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 286297
289601
WebGL context suddenly lost on buffers upload (iOS 18)
https://bugs.webkit.org/show_bug.cgi?id=289601
Summary
WebGL context suddenly lost on buffers upload (iOS 18)
Kimmo Kinnunen
Reported
2025-03-12 02:16:59 PDT
I have similar issue with pure WebGL2 API (ThreeJS) on same devices, iOS 18 Context suddenly lost on buffers upload. Context can not be created after page reload, requires browser kill-restart. Can create a minimal example to reproduce, if needed Here is a zip to reproduce, open index.html with iOS safari console shows "context lost" webgl context can not be created until browser killed
https://drive.google.com/file/d/11DlSrLWyvUI4gAmZk8duuzD1HHmgQN4S/view?usp=sharing
From
bug 286297
Attachments
Add attachment
proposed patch, testcase, etc.
Kimmo Kinnunen
Comment 1
2025-03-12 02:19:54 PDT
Original Reporter, could you provide the exact devices you are seeing the problem? I cannot repro immediately with iPhone 12 Pro I do see errors in the console: [Error] Failed to load resource: the server responded with a status of 404 (File not found) (e9140837.js.map, line 0) [Error] Failed to load resource: the server responded with a status of 404 (File not found) (index.js.map, line 0) [Error] Failed to load resource: the server responded with a status of 404 (File not found) (index.js.map, line 0) [Error] Failed to load resource: the server responded with a status of 404 (File not found) (92ea56b3.js.map, line 0) [Error] Failed to load resource: the server responded with a status of 404 (File not found) (f7b937b1.js.map, line 0) [Error] Failed to load resource: the server responded with a status of 404 (File not found) (fabf3b3d.js.map, line 0) [Error] Failed to load resource: the server responded with a status of 404 (File not found) (TrimbimWorker.js.map, line 0)
Radar WebKit Bug Importer
Comment 2
2025-03-19 07:33:36 PDT
<
rdar://problem/147409007
>
rohan
Comment 3
2025-03-25 05:21:38 PDT
I have been facing the issue with my app on following devices I have access to - M4 iPads (Air and Pro) (iOS 18.3.2) M3 Max Macbook Pro 16" (MacOS 15.3.1) Issue is not present on my iPhone 12 Pro (iOS 18.3.2) as well as intel/M1/M2/M3 iPads. May be present in other devices apart from these. Minimum version of my app displaying the diamonds eyewear frame can be found on
https://3d.sprie.io/dita_diamonds/
rohan
Comment 4
2025-03-25 05:31:56 PDT
The results are same as the OP has reported. WebGL context lost. Once this occurs, all other WebGL apps stop working. The ones that have been already loaded in other tabs before this error will also break when coming to foreground. New app instance starts with WebGL context lost. Safari needs hard restart to resolve these. Sometimes entire Safari session becomes corrupted, regardless of whether it has any WebGL components. Sometimes MacBook completely freezes and needs hard restart.
robyer1
Comment 5
2025-03-27 09:59:45 PDT
I am also finding this issue reproducible in both Safari and also Safari Webview in Flutter InAppWebView on an iPad Pro 6th generation Safari, iPhone 13 mini Safari, Mac Mini M1 MacOS Safari using the following test website built on ThreeJS if you use the red buttons at the top to directly navigate between the two 3D pages, sometimes the context is lost or on dispose of the WebGL context, the new webpage loading can get stuck in a loop of reloading or load a blank page or crash safari.
https://demo.epm.agency/safarikiller2/threejs/main/
robyer1
Comment 6
2025-03-28 04:17:27 PDT
Here is a video recorded on the iPad Pro demonstrating what happens when I am switching between the 3d webpages a few times before it white screens and crashes. The same behaviour is observed in Webview on iOS.
https://drive.google.com/file/d/1685t3NQEHJQuFPPvKZyuxG6yt-YqPX-u/view?usp=sharing
Kimmo Kinnunen
Comment 7
2025-03-28 05:38:10 PDT
>
https://demo.epm.agency/safarikiller2/threejs/main/
Thanks for the report. This page uses 2.7gb of memory when loaded on desktop. If that's same amount on iPad, the context is lost due to running out of memory. If there's more to this, feel free to comment or open a new specific bug. The more specific you can be and the smaller the reproduction case, the easier it is to fix.
Kimmo Kinnunen
Comment 8
2025-03-28 05:51:01 PDT
>
https://3d.sprie.io/dita_diamonds/
Tracking this in
bug 290620
robyer1
Comment 9
2025-03-28 05:56:52 PDT
(In reply to Kimmo Kinnunen from
comment #7
)
> > >
https://demo.epm.agency/safarikiller2/threejs/main/
> > Thanks for the report. This page uses 2.7gb of memory when loaded on > desktop. If that's same amount on iPad, the context is lost due to running > out of memory. > > If there's more to this, feel free to comment or open a new specific bug. > The more specific you can be and the smaller the reproduction case, the > easier it is to fix.
Here is a smaller repro page, I have many websites that this issue happens with only when on Safari on iOS. Webview on iOS and Safari on MacOS on all my devices: iPhone 13 mini iPad Pro 2020 Mac Mini M1
https://demo.epm.agency/epmpitest/index.html
robyer1
Comment 10
2025-03-28 06:03:08 PDT
*Click the hotspots in the sample above to move to the next page, then use the red button at the top to go back to the main page
Kimmo Kinnunen
Comment 11
2025-03-28 06:07:55 PDT
>
https://demo.epm.agency/epmpitest/index.html
Thanks, tracking this in
bug 290623
Filipp Keks
Comment 12
2025-03-28 06:10:58 PDT
I can reproduce safari crash with with example
https://drive.google.com/file/d/11DlSrLWyvUI4gAmZk8duuzD1HHmgQN4S/view?usp=sharing
iPad Pro (12.9-inch) (4th generation) Model number: MY2H2HC/A iPadOS: 18.3.1 after some trial and error, i found out, that this glsl vertex shader line is triggering crash flat varying vec3 flatNormal; crash happens even if flatNormal value is unused probability of crash increases with increase of amount of vertices when amount of vertices go above ~30000 crash is almost 100% removing "flat" directive, makes issue disappear completely
Kimmo Kinnunen
Comment 13
2025-03-28 06:24:48 PDT
>crash happens even if flatNormal value is unused
Thanks for confirming. I can repro that this is the same bug as
bug 286297
. If the provoking vertex doesn't matter for the renddering,
https://registry.khronos.org/webgl/extensions/WEBGL_provoking_vertex/
should be used to ensure good perf on Apple and perhaps Windows devices. *** This bug has been marked as a duplicate of
bug 286297
***
Kimmo Kinnunen
Comment 14
2025-03-28 06:26:31 PDT
And to add: The use of WEBGL_provoking_vertex should also solve the context loss. E.g. add: const epv = gl.getExtension('WEBGL_provoking_vertex'); if (epv) { epv.provokingVertexWEBGL(epv.FIRST_VERTEX_CONVENTION_WEBGL); }
Filipp Keks
Comment 15
2025-03-28 06:46:37 PDT
enabling FIRST_VERTEX_CONVENTION_WEBGL using WEBGL_provoking_vertex extension, fixed the crash thanx for the tip!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug