godot icon indicating copy to clipboard operation
godot copied to clipboard

macOS Safari 16.1 (latest version) - all HTML5 exports crash on loading (even empty projects with default settings)

Open NianoTT opened this issue 2 years ago • 26 comments


Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.


Godot version

3.5.1, 3.4.5

System information

macOS Monterey 12.6.1, Safari 16.1

Issue description

Since the update to Safari 16.1 on macOS (Macbook Pro early 2015, macOS 12.6.1), every Godot HTML5 export (GLES2 and GLES3) crashes on loading, even empty projects with no settings changed.

It looks exactly like in the video in this report: https://github.com/godotengine/godot/issues/62445 and might be a similar issue. I can not check it on iOS as I don't have a device capable of running the latest version.

This basically prevents any Godot game from running on a Mac with the latest Safari version.

Steps to reproduce

  • Export anything to HTML5
  • run in Safari 16.1 on macOS
  • crashes on load

Minimal reproduction project

any project, even empty (main scene with one Node2D)

NianoTT avatar Oct 27 '22 16:10 NianoTT

Update: same happens with Gnome Web version 43.0, which also uses the WebKit rendering engine.

NianoTT avatar Oct 28 '22 21:10 NianoTT

I can confirm this, all Godot web builds crash with Safari Browser 16.1

If anyone knows how to fix this, please tell as this is very detrimental to any web game made with Godot.

Faeovin avatar Oct 30 '22 11:10 Faeovin

Same here with Godot 4 and the latest beta. Working fine on windows/linux web browser.

Fran6nd avatar Nov 06 '22 20:11 Fran6nd

Update: same happens with Gnome Web version 43.0, which also uses the WebKit rendering engine.

Please report this to WebKit upstream, as this is a regression on their end. Also, open the developer tools then reload the page to get a full error log.

Calinou avatar Nov 07 '22 01:11 Calinou

Please report this to WebKit upstream, as this is a regression on their end. Also, open the developer tools then reload the page to get a full error log.

This was tested by someone else I asked, I don't have Gnome installed myself.

Maybe someone reading this can report it there? Otherwise I'll install it and get the error log myself.

NianoTT avatar Nov 07 '22 13:11 NianoTT

Could affected users provide some more information on what issue you're experiencing exactly?

  • macOS or iOS version, architecture, GPU
  • Browser versions, and exact symptoms for each browser (seems like it might be crashing on Chrome but not Safari?)
  • Reproducible with GLES2, GLES3, or both?
  • Does the Web editor work? https://editor.godotengine.org/
  • Do you have a reproducer online that crashes for you?
  • Does it crash on all Apple hardware you have available, or just specific devices?
  • For each buggy scenario, can you open the dev console and retrieve logs to attach here?

akien-mga avatar Nov 16 '22 12:11 akien-mga

More information would help create a bug report on https://bugs.webkit.org/

Thanks for the heads up.

karlcow avatar Nov 16 '22 13:11 karlcow

(Adding info from a mastodon chat with Rémi.)

  • macOS 12.6.1
  • Safari 16.1
  • 2016 MacBook Pro (Intel) & 2019 iMac (Intel)
  • loading test project pointed to by Rémi.

On both machines it loads with both GLES2 and GLES3.

GLES2 Screen Shot 2022-11-16 at 06 56 23

GLES3 Screen Shot 2022-11-16 at 06 57 08

@akien-mga pointed out the the GLES3 problem with the shading is probably this one.

asmaloney avatar Nov 16 '22 13:11 asmaloney

Could affected users provide some more information on what issue you're experiencing exactly?

* macOS or iOS version, architecture, GPU

mac OS 12.6.1, Intel, Macbook Pro early 2015, GPU: Intel Iris 6100 1.5GB

* Browser versions, and exact symptoms for each browser (seems like it might be crashing on Chrome but not Safari?)

Safari 16.1:

  • loads to the point where the console prints Godot version, then reloads the page, and gives the "A problem repeatedly occured on " error message.

Chrome:

  • works, no issues
* Reproducible with GLES2, GLES3, or both?

both

* Does the Web editor work? https://editor.godotengine.org/

same crash with Safari

* Do you have a reproducer online that crashes for you?

everything, your test project crashes

* Does it crash on all Apple hardware you have available, or just specific devices?

I only have this one Apple device

* For each buggy scenario, can you open the dev console and retrieve logs to attach here?

It only prints:

Godot Engine v3.5.1.stable.official.6fed1ffa3 - https://godotengine.org/
OpenGL ES 2.0 Renderer: WebKit WebGL

Also does not load on Gnome Web (uses WebKit) on Linux the same way on my PC.

I've been asking others to try, and it seems to not affect everyone, some don't have the issue on Apple hardware. I thought it might be GPU driver related, but that would not explain why Gnome on Linux is also affected (AMD 3800x CPU, 1080ti GPU).

NianoTT avatar Nov 16 '22 14:11 NianoTT

Also does not load on Gnome Web (uses WebKit) on Linux the same way on my PC.

I just tried Gnome Web/Epiphany on Linux (version 43.0), and I can reproduce some issues, though I can't say if it's the same as on Safari and/or Chrome on macOS:

  • Web editor doesn't work, before Epiphany doesn't support SharedArrayBuffer (multi-threaded support). That's expected and not a bug, shouldn't be related to the macOS issues.

  • GLES3 / WebGL 2 single-threaded projects don't work because Epiphany doesn't support WebGL 2. It probably doesn't build ANGLE for this like Apple does for its own WebKit. So this should also not be related to the macOS issues.

  • GLES2 / WebGL 1 single-threaded projects spam a lot of GL errors (tested with https://github.com/KOBUGE-Games/jetpaca and a local one-click deploy from Godot 3.5.1):

[Log] Godot Engine v3.5.1.stable.official.6fed1ffa3 - https://godotengine.org (tmp_js_export.js, line 354)
[Log] OpenGL ES 2.0 Renderer: WebKit WebGL (tmp_js_export.js, line 354)
[Error] WARNING: GL_INVALID_VALUE: A numeric argument is out of range.
[Error]    at: gl_check_errors (drivers/gles2/rasterizer_gles2.cpp:491) - GL_INVALID_VALUE: A numeric argument is out of range.
[Log]   (tmp_js_export.js, line 354)
[Log] Level: (1, 1) path: res://stages/world_1/intro.tscn (tmp_js_export.js, line 354)
[Log] Level: (1, 2) path: res://stages/world_1/forest_fun.tscn (tmp_js_export.js, line 354)
[Log] Level: (1, 3) path: res://stages/world_1/roller_coaster.tscn (tmp_js_export.js, line 354)
[Log] Level: (1, 4) path: res://stages/gcon/demo_gcon_004.tscn (tmp_js_export.js, line 354)
[Log] Level: (1, 5) path: res://stages/gcon/demo_gcon_006.tscn (tmp_js_export.js, line 354)
[Error] WebGL: INVALID_ENUM: bindTexture: invalid target
[Error] WebGL: INVALID_ENUM: texParameter: invalid texture target
[Error] WebGL: INVALID_ENUM: texParameter: invalid texture target

... and more ...

Full log with stacktraces for the errors: epiphany-error-log-webgl1.log

Worth noting that the process doesn't crash, the music of the main menu actually plays, but nothing renders. Click randomly seems to trigger game logic, still without rendering.

BTW pro-tip for Epiphany, as they don't seem to mention it anywhere and it's not accessible from the menus: the hotkey for the dev tools is Ctrl+Shift+I, like in Chromium.

akien-mga avatar Nov 16 '22 14:11 akien-mga

WebKit bug report: https://bugs.webkit.org/show_bug.cgi?id=247860

akien-mga avatar Nov 16 '22 14:11 akien-mga

If needed for testing, I've uploaded WebGL 1.0 and 2.0 builds of Jetpaca from Godot 3.5.1:

  • WebGL 1.0: https://akien.itch.io/jetpaca
  • WebGL 2.0: https://akien.itch.io/jetpaca-webgl2

And for non Godot users some steps to reproduce to export a project locally and see if the bug(s) is (are) reproducible: https://bugs.webkit.org/show_bug.cgi?id=247860#c9

akien-mga avatar Nov 16 '22 15:11 akien-mga

I've seen the issue with black materials on my iPhone with safari using WebKit 605/604.

I've briefly checked if this reproduces on the WPE WebKit port on Linux, and with the latest WebKit from main, I couldn't reproduce it. In the upcoming days I'll try to reproduce it on linux, on older branches (corresponding to WebKit 605/604 the Safari uses) and if I succeed it will mean that the issue is WebKit-specific. That would make it possible for me to narrow down and fix hopefully.

Scony avatar Nov 16 '22 22:11 Scony

In the upcoming days I'll try to reproduce it on linux, on older branches (corresponding to WebKit 605/604 the Safari uses) and if I succeed it will mean that the issue is WebKit-specific. That would make it possible for me to narrow down and fix hopefully.

If it helps, I was able to reproduce a black screen issue on Lubuntu using the resources Akien linked above (i.e. using the Gnome Web browser which is Webkit based, and running the jetpaca demo). Interestingly, I did not get any errors reported in the console.

clayjohn avatar Nov 17 '22 06:11 clayjohn

If needed for testing, I've uploaded WebGL 1.0 and 2.0 builds of Jetpaca from Godot 3.5.1:

* WebGL 1.0: https://akien.itch.io/jetpaca

* WebGL 2.0: https://akien.itch.io/jetpaca-webgl2

And for non Godot users some steps to reproduce to export a project locally and see if the bug(s) is (are) reproducible: https://bugs.webkit.org/show_bug.cgi?id=247860#c9

Sorry if I am misunderstanding something, but I wanted to give it a try just to see if I could replicate it, but both of these load and play fine on my Macbook.

macOS 12.6.1 Safari Version 16.1 (17614.2.9.1.13, 17614) Macbook Pro 2020 (intel)

MaxFletcher avatar Nov 20 '22 16:11 MaxFletcher

All WebGL games crash almost immediately, some WebGL2 games work (through WebGL2 experimental option), but presented with black screen, some WebGL2 games either reported losing WebGL context due to shader compilation crash, or crash and immediate website refresh.

iPadOS 15.7.1 (19H117) Safari Version: same as iPadOS iPad Mini (4th generation)

SysError99 avatar Nov 30 '22 08:11 SysError99

@akien-mga @NanitesNanites When the page crashes in Safari 16.1, is there an associated crash in console.app > Crash Reports > com.apple.WebKit.WebContent?

djg avatar Dec 11 '22 22:12 djg

@akien-mga @NanitesNanites When the page crashes in Safari 16.1, is there an associated crash in console.app > Crash Reports > com.apple.WebKit.WebContent?

@djg Yes, I attached it.

com.apple.WebKit.WebContent-2022-12-12-010455.000.ips.txt

NianoTT avatar Dec 12 '22 00:12 NianoTT

https://bugs.webkit.org/show_bug.cgi?id=247860#c15

Looks like it's fixed on Webkit 👍

Will test when the next Safari Version/Patch is out.

NianoTT avatar Dec 22 '22 14:12 NianoTT

Quick update, issue still present in Safari 16.3 on my machine. Don't know if the Webkit fix has been incorporated into Safari yet, at least I couldn't find it in patch notes.

NianoTT avatar Feb 02 '23 14:02 NianoTT

Exporting a web build from Godot 4.0b17 and testig it in Safari 16.3 on macOS 13.2 I do not get a crash on loading.

However, after the loading bar finishes the game just seems to get stuck processing something with a spinning loading icon (see below) that I haven't seen on any other platform. According to Activity monitor it's doing something, but not very intensely at about 1.5% CPU with little/no memory activity and after waiting 30+ minutes I've seen no change.

Screenshot 2023-02-02 at 15 56 15

lostminds avatar Feb 02 '23 15:02 lostminds

I get the same infinite spinning disk after the loading bar finishes on ios Safari 16.2 with Godot 4 RC1 with a blank project. Godot 3.5.1 works perfectly fine however.

ChildLearningClub avatar Feb 09 '23 03:02 ChildLearningClub

I get the same !! have you got news about it ?

dragonal42 avatar Feb 22 '23 22:02 dragonal42

Those who get crashes/infinite loading, can you tell which device/os version you are running? I'm trying to assemble a list of which are affected and which are not, might help the Webkit people to debug it.

NianoTT avatar Feb 22 '23 22:02 NianoTT

Hi thanks a lot ! this is my test site for a simple project with Godot 4 (with RC6 update - the same): https://billiar.info/jeux/tst/ On Edge, Chrome, Opera on windows 11, it is OK, but very long to run a simply project than before (godot 3) ...

and on IOS 16.2 or 16.3.x: with Chrome or Safari the website load, and go to infinity loop ...

i have another project : In Godot 3, and on IOS it is OK : https://billiar.info/jeux/conceptkids/ in Godot 4 (RC3) : on windows it is OK but with a long loading on IOS 16.3.x with Chrome or Safari it is infinity loop : https://billiar.info/jeux/conceptkids4/

dragonal42 avatar Feb 23 '23 10:02 dragonal42

Also the sale with final version 4 ! have you create a ticket ?

dragonal42 avatar Mar 07 '23 16:03 dragonal42

We also get this issue, with the error Out Of Memory. I think it is related to the multithreading feature, because Godot 3X works, but if you enable multithreading it gives out the same error. The maximum memory available is 384MB, and I think the initialization code tries to allocate more using sharedarraybuffers. image

stefano-elysium avatar Mar 27 '23 10:03 stefano-elysium

After adding this code to the index.js and limiting the maximum memory, the error is different.

var MEMORY_MAXIMUM;
if( navigator.userAgent.indexOf("iPhone") >= 0 ) {
 MEMORY_MAXIMUM = 402653183 / 65536; //iOS has this wonderful 384mb limit
 console.log("LIMITING MAX MEMORY USAGE TO 384mb BECAUSE iOS")
} else {
 MEMORY_MAXIMUM = 2147483648 / 65536;
}

if (ENVIRONMENT_IS_PTHREAD) {
 wasmMemory = Module["wasmMemory"];
 buffer = Module["buffer"];
} else {
 if (Module["wasmMemory"]) {
  wasmMemory = Module["wasmMemory"];
 } else {
  wasmMemory = new WebAssembly.Memory({
   "initial": INITIAL_MEMORY / 65536,
   "maximum": MEMORY_MAXIMUM,
   "shared": true
  });
  if (!(wasmMemory.buffer instanceof SharedArrayBuffer)) {
   err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");
   if (ENVIRONMENT_IS_NODE) {
    console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)");
   }
   throw Error("bad memory");
  }
 }
}

The error becomes: Unhandled Promise Rejection: CompileError: WebAssembly.Module doesn't parse at byte 5: can't get Function local's type in group 1, in function at index 33425

stefano-elysium avatar Mar 27 '23 11:03 stefano-elysium

Good news: with Safari 16.4 the crash on loading is fixed!

Would be nice if others that were affected could confirm, since the behaviour seems different between different hardware.

Also sidenote, performance degraded quite a bit with Safari 16.4 compared to 16.0, which was the last version I could use without it crashing on load. It lost at least 25% fps (my test project didn't changed). Guess nothing that can be done from Godot side of things as I'm sure thats a Safari issue, just might be worth mentioning.

NianoTT avatar Mar 27 '23 21:03 NianoTT

Also sidenote, performance degraded quite a bit with Safari 16.4 compared to 16.0, which was the last version I could use without it crashing on load. It lost at least 25% fps (my test project didn't changed). Guess nothing that can be done from Godot side of things as I'm sure thats a Safari issue, just might be worth mentioning.

@NanitesNanites do you have a specific test to reproduce the loss of performances.

tracked on rdar://107286259 at @Apple

karlcow avatar Mar 27 '23 22:03 karlcow