godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.25k stars 21.22k forks source link

Mono HTML5 Export Fails to Load: call_indirect to a null table entry. #35263

Closed nhold closed 4 years ago

nhold commented 4 years ago

Godot version: Godot Engine V3.2.rc1.mono.official

OS/device including version: iPhone Xr - iOS / 13.2.3 - Chrome Version 7.0.3945.73

Issue description: Game fails to load with error: call_indirect to a null table entry (evaluating 'Module["asm"]["Ak"].apply(null,arguments)')

Steps to reproduce: Export a game with Mono\C# to HTML, load on iPhone

Minimal reproduction project:

akien-mga commented 4 years ago

Do you get the same issue with the classical HTML5 build?

nhold commented 4 years ago

I am not sure, I would say so.

What's interesting is I can confirm the ["Ak"] symbol does exist in the wasm file, I think it has issues if the wasm file takes too long to download or initialise? If I manually debug through the js I get a TypeError: Module.asm.dk is undefined on desktop.

I added some custom logging, here is the log from my game: https://pastebin.com/cmb3x4zh


_emscripten_asm_const_iii@https://v6p9d9t4.ssl.hwcdn.net/html/1901231/export/index.js:1464:33
wasm-stub@[wasm code]
<?>.wasm-function[28459]@[wasm code]
wasm-stub@[wasm code]
Bk@[native code]
https://v6p9d9t4.ssl.hwcdn.net/html/1901231/export/index.js:15450:36
callMain@https://v6p9d9t4.ssl.hwcdn.net/html/1901231/export/index.js:15846:30
synchronousStart@https://v6p9d9t4.ssl.hwcdn.net/html/1901231/export/index.js:16130:23
apply@[native code]
promiseReactionJob@[native code]
ERRORcall_indirect to a null table entry (evaluating 'Module["asm"]["Ak"].apply(null, arguments)')```
Calinou commented 4 years ago

See also https://github.com/godotengine/godot/issues/26554. (Chrome on iOS uses the same rendering engine as Safari on iOS.)

clemens-tolboom commented 4 years ago

Godot version: Godot_v3.2-stable_osx.64

OS/device including version: Safari Version 13.0.5 (14608.5.12) on Mac Mojave 10.14.6

Issue description: Error call_indirect to a null table entry (evaluating 'Module["asm"]["Hi"].apply(null,arguments)')

Calinou commented 4 years ago

@clemens-tolboom Out of curiosity, can you reproduce this in another browser?

clemens-tolboom commented 4 years ago

Nope. It works in ✅ Chrome, Firefox and Chromium on my Macbook.

clemens-tolboom commented 4 years ago

Testing on

Android 8.0.0 (Samsung Galaxy A5 (2017):

On Android 10:

clemens-tolboom commented 4 years ago

Hmmm on Safari

So my case is probably Safari only related.

(my 2 cents)

lawnjelly commented 4 years ago

This may be related but I was just testing an HTML game on Firefox 74.0 on Linux Mint, and after the loading bar had finished loading, got an error:

Indirect call to null

I thought it might be just that godot game then I tried a few more and they are all giving this. As far as I know godot html games used to work on my firefox, the only change I'm presuming has been updating firefox. Although it is possible there's something in my security settings that might be causing it, I'll report back if I can get it working.

Games tested: https://asheraryam.itch.io/your-choice https://picster.itch.io/elite-monkey-pogo-eod https://flyingoctopus.itch.io/wojowniczy-myszojelen

Faless commented 4 years ago

@lawnjelly not sure about Firefox 74 since I just updated to FF75 on Ubuntu 18.04, and all the links seems to work there. In my experience, Indirect call to null sometimes happens when testing games and reloading the same page multiple times, or when you updated the export template but the wasm is still cached in the browser (in which case, you should try to clear the cache).

clemens-tolboom commented 4 years ago

FF @ Mac

74

Console reports for https://asheraryam.itch.io/your-choice

then after around 2 minutes

displayFailureNotice https://v6p9d9t4.ssl.hwcdn.net/html/1883702-244014/index.html:248

75

After updating from 74 https://asheraryam.itch.io/your-choice shows progressbar then indirect call to null and cookie block

Request to access cookie or storage on “https://v6p9d9t4.ssl.hwcdn.net/html/1883702-244014/index.html” was blocked because we are blocking all third-party storage access requests and content blocking is enabled.

Faless commented 4 years ago

@clemens-tolboom did you try clearing your browser cache? I'm still not getting that error :'(

akien-mga commented 4 years ago

Note that Firefox 74 is broken: #37245.

lawnjelly commented 4 years ago

Got it working! It seems to be something in the security settings, haven't got it pinned down exactly but it was set to block:

Custom:
* Cookies (cross-site and social media trackers)
* Tracking content (only in private windows)
* Cryptominers
* Fingerprinters

I unblocked these and it ran. Then I blocked them again and it ran. Then I blocked them, cleared the cache (and I presume cookies) and it still ran. Very peculiar. Does sound like some security thing screwing it up in firefox, possibly a firefox bug.

clemens-tolboom commented 4 years ago

@clemens-tolboom did you try clearing your browser cache? I'm still not getting that error :'(

I ran in a different profile using /Applications/Firefox.app/Contents/MacOS/firefox --ProfileManager which made the game https://asheraryam.itch.io/your-choice run correctly.

I saw these messages but that maybe due to running from console.

!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost

Unable to read VR Path Registry from /Users/clemens/Library/Application Support/OpenVR/.openvr/openvrpaths.vrpath

jlight0311 commented 4 years ago

I just ran into this as well on an iPhone X hosted itch.io but webserver was fine. Had to go to phones Settings -> Safari -> Privacy & Security -> Disable Prevent Cross-Site Tracking and leave disabled.

Reneator commented 4 years ago

I also ran into the problem on fire-fox (77.0.1) right now, where my productive game on itch.io goes into black-screen with the console-message:

RuntimeError: indirect call to null

clemens-tolboom commented 4 years ago

@Reneator please check your privacy settings as something is blocked (cookie, sites) and please next time add a link to your game :-/

I have latest FF 78.0.1 @ MacOS and did same again: start FF from the shell /Applications/Firefox.app/Contents/MacOS/firefox --ProfileManager using an almost empty profile allowing everything.

All games listed by @lawnjelly in https://github.com/godotengine/godot/issues/35263#issuecomment-611358525 ran :ok:

[updated]

Firefox @ Mac

Safari @ iOS 13.4.1

Reneator commented 4 years ago

@clemens-tolboom Hi, didnt think people would care, so here it is:

https://reneator.itch.io/progress-game

The kinds of errors you get seem to differ from system to system and from browser to browser. For some its A-Ok, for other its just glitching, stuttering, black-screening etc. Especially around the Tooltip-functionality that i built.

clemens-tolboom commented 4 years ago

@Reneator guess it's best to discus on Discord ... you may ping me their.

@all

nhold commented 4 years ago

I re-tested my game: https://nhold.itch.io/quickdrop with:

Chrome: 84.0.4147 OS: iOS 13.2.3 Godot: v3.2.2.stable.mono.official

(I also tested Safari, with permissions changed but no difference to Chrome).

I no longer get the same logs, instead:

LOGIndexedDB not available: IDBFactory.open() called in an invalid security context

LOGGodot Engine v3.2.2.stable.mono.official - https://godotengine.org/ 

and the loading icon animates for a while and then you just receive a black screen.

Even running from the direct link (So no iframe) doesn't work, but I don't see the error (So likely the initial error is a tracking\cors thing?)

Faless commented 4 years ago

The original error seemed related to Godot not handling correctly case where IndexedDB was not allowed, and was fixed via #39538 in 3.2.2 and #38587 in master (so that persistent file system is disabled when not available). Can anyone still reproduce with 3.2.2?

@nhold about the black screen on iOS, your game seems to use GLES3, which gets translated to WebGL2 in web exports, iOS Safari does not support it. Try converting your game to GLES2 if you want to target the web, especially on mobile.

nhold commented 4 years ago

@Faless Unfortunately GLES2 still ends in a black screen.

Faless commented 4 years ago

@nhold do you get any error in console? I think it might be a separate issue in any case.

nhold commented 4 years ago

I don't want to post more about that issue as it may be a separate issue. I do believe this specific issue is no longer relevant unless others can still reproduce it?

Faless commented 4 years ago

@nhold agreed. Closing this as fixed via #39538 . Feel free to open another issue with minimal reproduction project for your black screen bug.