Page 1 of 1

[2.0.21] Game closes "Quitting: window closed." when machine is placed during saving

Posted: Sat Nov 23, 2024 11:50 pm
by Daniel_I_Am
The game crashes if a modification is made to the world (by placing a machine for instance) while the saving progress bar dialogue is visible.

What did you do?
I was able to reproduce this pretty consistently with some effort. It seems to be independent of a specific save.

I created a new save, ran `/cheat` to give me a set of legendary Mech Armor with a bunch of legendary Exoskeletons to move as fast as I could. Then I just placed a bunch of machines (or even ghosts) while moving. I set the autosave interval to 1 minute to speed up reproduction. See attached reproduction video for a visual version of this explanation.

Wait for the autosave timer to tick down to zero while placing ghosts and the game crashes.

What happened?
The game crashes.

What did you expect to happen instead? It might be obvious to you, but do it anyway!
The game not to crash and process the request to a place a machine after the saving is done.

Does it happen always, once, or sometimes?
In normal play, it happens sometimes, varying between once an hour or not at all during an entire play session.
When attempting to reproduce, I can get it to happen about half the time.

Environmental details
Game version: 2.0.21 (I noticed this on 2.0.20 current stable, but switched to latest experimental to verify it was still happening there)
OS: Linux (Arch)
Also of note: The save is written to an HDD, which will likely cause longer saving times.

Unfortunately, I see nothing in the log files explaining the crash. Full log files of two crashes attached.
95.368 Info AppManager.cpp:310: Saving to _autosave3 (blocking).
96.368 Info GlobalContext.cpp:1965: Waiting for save to finish.
96.518 Quitting: window closed.
96.518 Info GlobalContext.cpp:760: Deleting active scenario.
96.894 Steam API shutdown.
96.896 Goodbye

Re: [2.0.21] Game closes "Quitting: window closed." when machine is placed during saving

Posted: Sun Nov 24, 2024 1:25 pm
by Rseding91
This sounds like the linux operating system issue where it has a limited size buffer for input/window events and if the process doesn't consume them because it's doing something else intensive they fill and the operating system force closes the program.

This thing https://www.reddit.com/r/kde/comments/1 ... increases/

Which is outside of our control however terrible of a user experience it is.

Re: [2.0.21] Game closes "Quitting: window closed." when machine is placed during saving

Posted: Sun Nov 24, 2024 4:17 pm
by Daniel_I_Am
I see, it is reproducible by just performing inputs during the save in general. I just happened to have only noticed it during attempts to place a machine in the world.

So this is a problem in Wayland, not Factorio. Especially seeing how saves tend to take longer now that there are multiple surfaces/planets involved in the game.

Not an ideal user experience indeed. At least it still successfully creates the save, so after restarting you can jump in immediately.

I have for now switched the preferred rendering engine back to X11 instead of Wayland (which is unfortunate, since the game does look better on Wayland), in case through XWayland the buffer is handled properly during saves.

Re: [2.0.21] Game closes "Quitting: window closed." when machine is placed during saving

Posted: Thu Dec 19, 2024 12:01 am
by raiguard
What clients are "supposed" to do is reconnect to the compositor after they were disconnected, but in practice, nobody does this.

In any case, this would be up to SDL to solve, since we don't interface with Wayland directly.