Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NianoTT opened this issue Oct 27, 2022 · 45 comments

Comments

@NianoTT
Copy link

NianoTT commented Oct 27, 2022


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: #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 NianoTT changed the title macOS Safari 16.1 - all HTML5 exports crash on loading (even empty projects with default settings) macOS Safari 16.1 (latest version) - all HTML5 exports crash on loading (even empty projects with default settings) Oct 28, 2022
@NianoTT
Copy link
Author

NianoTT commented Oct 28, 2022

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

@Faeovin
Copy link

Faeovin commented Oct 30, 2022

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.

@akien-mga akien-mga added this to the 3.6 milestone Nov 1, 2022
@Fran6nd
Copy link

Fran6nd commented Nov 6, 2022

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

@Calinou
Copy link
Member

Calinou commented Nov 7, 2022

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.

@NianoTT
Copy link
Author

NianoTT commented Nov 7, 2022

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.

@akien-mga
Copy link
Member

akien-mga commented Nov 16, 2022

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?

@karlcow
Copy link

karlcow commented Nov 16, 2022

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

Thanks for the heads up.

@asmaloney
Copy link
Contributor

(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.

@NianoTT
Copy link
Author

NianoTT commented Nov 16, 2022

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).

@akien-mga
Copy link
Member

akien-mga commented Nov 16, 2022

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
Copy link
Member

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

@akien-mga
Copy link
Member

akien-mga commented Nov 16, 2022

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

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

@Scony
Copy link
Contributor

Scony commented Nov 16, 2022

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.

@clayjohn
Copy link
Member

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.

@MaxFletcher
Copy link

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)

@NianoTT
Copy link
Author

NianoTT commented Feb 2, 2023

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.

@lostminds
Copy link

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

@ChildLearningClub
Copy link

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.

@dragonal42
Copy link

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

@NianoTT
Copy link
Author

NianoTT commented Feb 22, 2023

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.

@dragonal42
Copy link

dragonal42 commented Feb 23, 2023

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
Copy link

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

@stefano-elysium
Copy link

stefano-elysium commented Mar 27, 2023

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
Copy link

stefano-elysium commented Mar 27, 2023

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

@NianoTT
Copy link
Author

NianoTT commented Mar 27, 2023

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.

@karlcow
Copy link

karlcow commented Mar 27, 2023

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

@stefano-elysium
Copy link

related #70621

@stefano-elysium
Copy link

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

I tried on an ipad with 16.4 and it did NOT fix the issue

@NianoTT
Copy link
Author

NianoTT commented Mar 28, 2023

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

I just used a level from my game. It's not consitent enough to qualify as a proper benchmark but it did run significantly worse then before.

@dragonal42
Copy link

news: with Safari 16

it is so sad ...
the same too : it doesn't work anymore on ios iphone 16.4 :
https://billiar.info/jeux/joy/joy.html

in this example, i have test the new addon with "Cross Origin Isolation Service Worker" and it work !!! (without .htaccess modifications)
https://godotengine.org/asset-library/asset/1818

wait and see

@karlcow
Copy link

karlcow commented Oct 19, 2023

@NianoTT Do you or anyone here have a simple example which could show how the performance degraded from Safari 16.0 to Safari 16.4, and if it's better or not for Safari 17 ?
Without a concrete measurable example, it's hard to diagnose the exact issue.

@dragonal42
Copy link

More an more bad
iOS 17.1 or 17.2
Godot 4.1 or 4.2 doesnt work…

even Godot 3.5.4 who was funcrional in 16.x doesnt work anymore… so sad

exception thrown: TypeError: null is not an object (evaluating 'gl.getContextAttributes().antialias'),createOffscreenFramebuffer@https://billiar.info/jeux/conceptkids/index.js:9:120004
registerContext@https://billiar.info/jeux/conceptkids/index.js:9:126081
createContext@https://billiar.info/jeux/conceptkids/index.js:9:119558
_emscripten_webgl_do_create_context@https://billiar.info/jeux/conceptkids/index.js:9:189241
_emscripten_webgl_create_context@https://billiar.info/jeux/conceptkids/index.js:9:189380

.wasm-function[23471]@[wasm code] .wasm-function[15117]@[wasm code] .wasm-function[22487]@[wasm code]

@https://billiar.info/jeux/conceptkids/index.js:9:326105
callMain@https://billiar.info/jeux/conceptkids/index.js:9:331025
@https://billiar.info/jeux/conceptkids/index.js:696:28
Promise@[native code]
@https://billiar.info/jeux/conceptkids/index.js:691:25
null is not an object (evaluating 'gl.getContextAttributes().antialias')
IMG_8373

@SysError99
Copy link
Contributor

More an more bad iOS 17.1 or 17.2 Godot 4.1 or 4.2 doesnt work…

even Godot 3.5.4 who was funcrional in 16.x doesnt work anymore… so sad

exception thrown: TypeError: null is not an object (evaluating 'gl.getContextAttributes().antialias'),createOffscreenFramebuffer@https://billiar.info/jeux/conceptkids/index.js:9:120004 registerContext@https://billiar.info/jeux/conceptkids/index.js:9:126081 createContext@https://billiar.info/jeux/conceptkids/index.js:9:119558 _emscripten_webgl_do_create_context@https://billiar.info/jeux/conceptkids/index.js:9:189241 _emscripten_webgl_create_context@https://billiar.info/jeux/conceptkids/index.js:9:189380

.wasm-function[23471]@[wasm code] .wasm-function[15117]@[wasm code] .wasm-function[22487]@[wasm code]
@https://billiar.info/jeux/conceptkids/index.js:9:326105 callMain@https://billiar.info/jeux/conceptkids/index.js:9:331025 @https://billiar.info/jeux/conceptkids/index.js:696:28 Promise@[native code] @https://billiar.info/jeux/conceptkids/index.js:691:25 null is not an object (evaluating 'gl.getContextAttributes().antialias') IMG_8373

This was really weird. I have 3.5.3 projects running fine even with iPhone 7. Do you have the specifications of the device? Are there anything that you suspect to be a culprit?

@dragonal42
Copy link

More an more bad iOS 17.1 or 17.2 Godot 4.1 or 4.2 doesnt work…
even Godot 3.5.4 who was funcrional in 16.x doesnt work anymore… so sad
exception thrown: TypeError: null is not an object (evaluating 'gl.getContextAttributes().antialias'),createOffscreenFramebuffer@https://billiar.info/jeux/conceptkids/index.js:9:120004 registerContext@https://billiar.info/jeux/conceptkids/index.js:9:126081 createContext@https://billiar.info/jeux/conceptkids/index.js:9:119558 _emscripten_webgl_do_create_context@https://billiar.info/jeux/conceptkids/index.js:9:189241 _emscripten_webgl_create_context@https://billiar.info/jeux/conceptkids/index.js:9:189380
.wasm-function[23471]@[wasm code] .wasm-function[15117]@[wasm code] .wasm-function[22487]@[wasm code]
@https://billiar.info/jeux/conceptkids/index.js:9:326105 callMain@https://billiar.info/jeux/conceptkids/index.js:9:331025 @https://billiar.info/jeux/conceptkids/index.js:696:28 Promise@[native code] @https://billiar.info/jeux/conceptkids/index.js:691:25 null is not an object (evaluating 'gl.getContextAttributes().antialias') IMG_8373

This was really weird. I have 3.5.3 projects running fine even with iPhone 7. Do you have the specifications of the device? Are there anything that you suspect to be a culprit?

It is a iPhone 13 PRO and IOS 17.2 BETA public

@SysError99
Copy link
Contributor

@dragonal42 Although I found the culprit but it's completely fixable. Godot 3 with WebGL 2 is known to have a lot of issues and Godot 3 isn't the best at handling WebGL 2 on WebKit browsers. If you don't mind (judging by all elements you have on the game), you may switch the render to 1.0 version at the moment.

I know this is not a true solution at the long run (plus Godot 3 is likely to be dropped a support sooner or later depends on conditions), but for Godot 3 this is the best bet for you.

@dragonal42
Copy link

@SysError99 thanks a lot .. but i can't find WebGL 1.0 parameter in godot 3.5.4, can you help me please ?
my kids love my little games ! i think i will work on export them on ios app ...

@Calinou
Copy link
Member

Calinou commented Nov 7, 2023

but i can't find WebGL 1.0 parameter in godot 3.5.4, can you help me please ?

Switch the project to use GLES2 in the top-right corner of the editor. GLES2 maps to WebGL 1.0, whereas GLES3 maps to WebGL 2.0.

@dragonal42
Copy link

@Calinou Thanks ... but this version is also with this ... i will test to rebuild it

@iryan2

This comment was marked as off-topic.

@AThousandShips
Copy link
Member

AThousandShips commented May 12, 2024

this the issue to track for Godot 4 support for exporting to web

It is not, this is a specific issue, and for 3.x, please ask questions about this here first (it is a configuration error it seems) and then open a new report if it's a bug

@SysError99
Copy link
Contributor

SysError99 commented May 12, 2024

@iryan2 Make sure that you have satisfied the special requirements it said for Godot 4.x before jumping into the multitude of bugs that plague Apple-specific platforms. Making games with Godot 4.x for web is a mistake anyway.

  • SharedArrayBuffer, since Godot before 4.3 is always multi-threaded.
  • Cross Origin Isolation, same reason as above.

Depending on what CDN or hosting platforms you use, you have to tap on those configurations. It can't be done in Godot game's file. It's by the design of the browser's specs and out of control of Godot unless the version 4.3 makes it working without multi-threading again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Blockers / regressions
Development

No branches or pull requests