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

Async_handler crashes when Internet disconnects or connection times out #3239

Open
monokotech opened this issue Jun 11, 2024 · 1 comment
Open
Labels
Emscripten WebAssembly/JavaScript port for web browsers

Comments

@monokotech
Copy link

download_failure_retry of emscripten_async_wget2 may not callback due to timeout. And, if the resource loading fails, it cause the Player to crash.

Switching to offline during throttling will result in the following:

index.js:8546 
 GET http://127.0.0.1:8081/ep/games/2kki/Sound/door-hikido.wav net::ERR_INTERNET_DISCONNECTED
index.js:1132 Loading of Map Map0003.lmu failed.
The map was not found.

index.js:52 program exited (with status: 1), but keepRuntimeAlive() is set (counter=3) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)

index.js:175 Uncaught 
RuntimeError: memory access out of bounds
    at index.wasm.Player::UpdateInput(:8081/ep/EasyRPG-Mul…ve/build/index.wasm)
    at index.wasm.Player::MainLoop(:8081/ep/EasyRPG-Mul…ve/build/index.wasm)
    at index.wasm.main_loop(:8081/ep/EasyRPG-Mul…ve/build/index.wasm)
    at callUserCallback (index.js:7136:9)
    at Object.runIter (index.js:7211:11)
    at Browser_mainLoop_runner (index.js:7097:26)

And timeouts are difficult to reproduce. There is a chance of encountering net::ERR_TIMED_OUT (I'm not sure if it's spelled correctly) when the internet speed is extremely slow, which may result in neither download_success_retry nor download_failure_retry being called.

I want to ensure a callback by using emscripten_set_timeout. And add an overlay to display loading status and downloading progress instead of just showing a black screen.

@Ghabry Ghabry changed the title async_handler.cpp problem Async_handler crashes when Internet disconnects or connection times out Jun 11, 2024
@Ghabry Ghabry added the Emscripten WebAssembly/JavaScript port for web browsers label Jun 11, 2024
@monokotech
Copy link
Author

monokotech commented Jun 24, 2024

I have fixed the issue. However, more testing is needed to determine if it has truly been fixed.

See: monokotech/TsukiYumeRPG-Player@03f8e73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Emscripten WebAssembly/JavaScript port for web browsers
Development

No branches or pull requests

2 participants