cfoust / sour

Sauerbraten for the web in a single Docker image.
https://sourga.me/
MIT License
159 stars 30 forks source link

Game "Locks up" almost immediately after data is loaded and game is ready to play #14

Closed kwadroke closed 2 years ago

kwadroke commented 2 years ago

While attempting to play on sourga.me. Ater the game loads and is ready to play, the game locks up. I can hit Escape to release the mouse. The browser itself is still responding, just no response in-game.

Fedora Linux 35 Browser: Version 100.0.4896.60 (Official Build, ungoogled-chromium) (64-bit) (Also had same issue starting on 2022-04-03 on Chromum 98.x)

From The Console:

WebGL: INVALID_VALUE: texImage2D: invalid internalformat
sauerbraten.js:10410 WebGL: too many errors, no more errors will be reported to the console for this context.
_glTexImage2D @ sauerbraten.js:10410
$createtexture(int, int, int, void*, int, int, unsigned int, unsigned int, int, int, int, bool, unsigned int, bool) @ 008b38ce:0xe1b4
$newtexture(Texture*, char const*, ImageData&, int, bool, bool, bool, int) @ 008b38ce:0x53fef
$textureload(char const*, int, bool, bool) @ 008b38ce:0x81c5
$loadcaustics(bool) @ 008b38ce:0x7e38b
$setupmaterials(int, int) @ 008b38ce:0x72295
$allchanged5(void*) @ 008b38ce:0xf58db
func @ sauerbraten.js:5554
Browser_mainLoop_runner @ sauerbraten.js:4940
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
index.tsx:268 main loop blocker "allchanged5" took 612 ms
index.tsx:268 The Complex by Dacker & Nieb
index.tsx:268 main loop blocker "allchanged_next" took 3 ms
unsafe-startup.js:59 glMapBufferRange is only supported when access is MAP_WRITE|INVALIDATE_BUFFER
printErr @ unsafe-startup.js:59
_emscripten_glMapBufferRange @ sauerbraten.js:8610
$gle::begin(unsigned int, int) @ 008b38ce:0xcb928
$flushwater(int, bool) @ 008b38ce:0x44b46
$renderwater() @ 008b38ce:0x5091b
$glaretexture::dorender() @ 008b38ce:0x145e97
$rendertarget::render(int, int, int, float, int) @ 008b38ce:0x75a26
$main_loop_caller() @ 008b38ce:0x13cb1d
callUserCallback @ sauerbraten.js:4989
runIter @ sauerbraten.js:5051
Browser_mainLoop_runner @ sauerbraten.js:4966
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
setTimeout (async)
Browser_mainLoop_runner @ sauerbraten.js:4954
unsafe-startup.js:94 RuntimeError: null function or function signature mismatch
    at gle::end() (008b38ce:0x5507)
    at flushwater(int, bool) (008b38ce:0x44cc4)
    at renderwater() (008b38ce:0x5091b)
    at glaretexture::dorender() (008b38ce:0x145e97)
    at rendertarget::render(int, int, int, float, int) (008b38ce:0x75a26)
    at main_loop_caller() (008b38ce:0x13cb1d)
    at callUserCallback (sauerbraten.js:4989:3)
    at Object.runIter (sauerbraten.js:5051:4)
    at Browser_mainLoop_runner (sauerbraten.js:4966:20)
kwadroke commented 2 years ago

Working on Chromium 98. Maybe I tried to play in the middle of an update/new deployment?

kwadroke commented 2 years ago

Could have also been on my version of Chromium 100 as it is still doing it, but it was previously untested. Chromium 98 had the same as well but now working

kwadroke commented 2 years ago

Chromium 100 now working. Could have been a caching issue.

cfoust commented 2 years ago

I have seen this before; it's really random. Honestly I need to take a good look at the whole game startup flow; it's pretty clear that there are a lot of things that can cause deviations from the happy path. Emscripten's code seems to be pretty brittle in these situations; I will likely have to reimplement a lot of the startup logic.