Page 1 of 1

[2.0.43][Linux] Stuck at autosaving (probably a failed fork of the game process?)

Posted: Wed Apr 02, 2025 8:07 pm
by Synthe6
Hi,

I've had an issue where Factorio would randomly be stuck on autosaves at 0% and I'm wondering if an nproc security limit that is too low could be the culprit? An nproc security limit basically sets the max number of processes that can be opened but I'm wondering if we can have a more verbose log when the fork fail on Linux if that's the case?

Looking at the log (included to this post as "factorio-previous.log), I don't see anything really meaningful about if the fork has succeeded or not. For example, in the log file:

Code: Select all

3779.441 Info AppManager.cpp:323: Saving to _autosave2 (blocking).
5168.925 Info GlobalContext.cpp:1987: Waiting for save to finish.
5853.357 Error CrashHandler.cpp:643: Received 6
I see around 3779 the game is saving, but I don't notice it for a while, and at 5853, this is where I force-quit the game from the KDE desktop environment.

It also creates a .tmp save file that is corrupted (included with the post as "_autosave2.tmp.zip").

So yeah, I've had the security limits configured similar to what's described in the Arch wiki:
https://wiki.archlinux.org/title/Limits.conf
Which is:

Code: Select all

*           hard    nproc      2048        # Prevent fork-bombs from taking out the system.
This means that any user have a limit of 2048 processes that can be opened.
I didn't think much of it when I set that up a few months earlier but I've also upgraded it to 4096 as of writing this post. Maybe that'll fix the issue in the future (or I'll probably try to double that limit once more if the issue happens again).

Also, information about my system (EndeavourOS is Arch Linux based):

Code: Select all

neofetch
                     ./o.                  user@ordi-ki-x3d 
                   ./sssso-                --------------- 
                 `:osssssss+-              OS: EndeavourOS Linux x86_64 
               `:+sssssssssso/.            Host: MS-7D70 1.0 
             `-/ossssssssssssso/.          Kernel: 6.13.8-arch1-1 
           `-/+sssssssssssssssso+:`        Uptime: 27 mins 
         `-:/+sssssssssssssssssso+/.       Packages: 1472 (pacman), 56 (flatpak) 
       `.://osssssssssssssssssssso++-      Shell: fish 4.0.1 
      .://+ssssssssssssssssssssssso++:     Resolution: 3840x2160 
    .:///ossssssssssssssssssssssssso++:    DE: Plasma 6.3.3 
  `:////ssssssssssssssssssssssssssso+++.   WM: kwin 
`-////+ssssssssssssssssssssssssssso++++-   Theme: Breeze-Dark [GTK2], Breeze [GTK3] 
 `..-+oosssssssssssssssssssssssso+++++/`   Icons: breeze-dark [GTK2/3] 
   ./++++++++++++++++++++++++++++++/:.     Terminal: WarpTerminal 
  `:::::::::::::::::::::::::------``       CPU: AMD Ryzen 7 7800X3D (16) @ 5.050GHz 
                                           GPU: AMD ATI RX 9070/9070 XT 
                                           Memory: 11964MiB / 63966MiB 
And the current number of running processes from the same uptime as the command above:

Code: Select all

ps aux | wc -l
501

Re: [2.0.43][Linux] Stuck at autosaving (probably a failed fork of the game process?)

Posted: Wed Apr 02, 2025 11:17 pm
by Jap2.0
Because it says (blocking) I'm pretty sure yours is not forking to save.

Re: [2.0.43][Linux] Stuck at autosaving (probably a failed fork of the game process?)

Posted: Wed Apr 02, 2025 11:22 pm
by Synthe6
Did that feature got removed in linux builds? I've checked in settings and I don't even see the checkbox for non-blocking saves anymore (I was on Windows about half a year ago). Or is that just for server builds?

Re: [2.0.43][Linux] Stuck at autosaving (probably a failed fork of the game process?)

Posted: Thu Apr 03, 2025 2:36 am
by pioruns
Synthe6 wrote: Wed Apr 02, 2025 11:22 pm Did that feature got removed in linux builds? I've checked in settings and I don't even see the checkbox for non-blocking saves anymore (I was on Windows about half a year ago). Or is that just for server builds?
I am using it on Linux, works well. Last time I checked, it was one of hidden options in secret menu. This setting is working on Linux only.

Re: [2.0.43][Linux] Stuck at autosaving (probably a failed fork of the game process?)

Posted: Thu Apr 03, 2025 3:35 am
by Jap2.0
Yep, exists but hidden (last I knew) and Linux-only. Either edit the config file or there's something like ctrl+alt click or ctrl+shift click on settings and it'll show up.

Re: [2.0.43][Linux] Stuck at autosaving (probably a failed fork of the game process?)

Posted: Thu Apr 03, 2025 2:52 pm
by Rseding91
Given there's nothing in the log, and this wasn't non-blocking saving, I don't see anything workable with this report. If you know of a way to reproduce the freeze let us know. Otherwise, there's nothing we can do.

Re: [2.0.43][Linux] Stuck at autosaving (probably a failed fork of the game process?)

Posted: Thu Apr 03, 2025 9:47 pm
by Synthe6
I found the secret hidden menu, it was ctrl+shift on settings. I got the real non-blocking saves activated now. However, I've ran the game since last night and haven't had the issue happens again. Note that I did increase the nproc limit to 4096 since my original post.

Also, on a semi-related note, if it happens again, is there a way to trace what's really blocking the saving stuck at 0%? As far as I am aware, the game would keep on "running" in-definitively until I terminated the process (like with pkill or some task manager). Maybe some debugger can be attached to a running process so I can gather more info on what's happening?