[1.1.34] Main game hangs at the end of saving

Bugs that are actually features.
Post Reply
movax20h
Fast Inserter
Fast Inserter
Posts: 164
Joined: Fri Mar 08, 2019 7:07 pm
Contact:

[1.1.34] Main game hangs at the end of saving

Post by movax20h »

I am using a non-blocking saving feature on Linux desktop, and it usually works perfectly. Never had any crashes for last year or two, since I started using it.

I don't use any mods. I do have to loaded in the game, but not actually enabled on this map save.

I often also leave the game for hours alone playing and running, and then come back to it, to see what is broken. Often the main factorio process will have many days of wall clock time since it started with no ill effects.

However, today I found that while I was away, it did stop and hang. I had it running in the foreground, I was just standing in the middle of the factory, and had the production stats window open. This was weird, as this very same map was left alone before, with no issues.

And I see it was in the process of saving.

"Saving map _autosdave2", in the corner, with progress bar at 100%. I do have free space on file system, so that is not an issue.

Otherwise I can't interact with the game, it doesn't responds to mouse clicks, movements, keyboard, escape, Alt-Enter. The image on the screen is still, and doesn't change.

top shows 0% CPU usage.

ps aux shows:

Code: Select all

$ ps aux | grep factorio
user      634300  0.0  0.0  33100 25000 pts/2    S+   Jun11   0:00 /bin/sh -c /home/user/.steam/debian-installation/ubuntu12_32/../ubuntu12_32/reaper SteamLaunch AppId=427520 -- '/home/user/.steam/debian-installation/steamapps/common/Factorio/bin/x64/factorio'
user      634301  0.0  0.0  30480 24224 pts/2    S+   Jun11   0:00 /home/user/.steam/debian-installation/ubuntu12_32/../ubuntu12_32/reaper SteamLaunch AppId=427520 -- /home/user/.steam/debian-installation/steamapps/common/Factorio/bin/x64/factorio
user      634302  167  2.6 11004384 3539720 pts/2 Sl+ Jun11 3117:23 /home/user/.steam/debian-installation/steamapps/common/Factorio/bin/x64/factorio
user      928124  0.1  0.0      0     0 pts/2    Z+   02:18   0:03 [factorio] <defunct>
suggesting to me that the forked saver factorio process, just finished and is now should be waited by the parent factorio process.

(167% CPU is an average CPU usage since the start of the process, which as you can see is about 2 days ago).

I am attaching a 4 second sample of strace output (captured using strace -ttt -T -f -o factorio_hang_strace.txt -p 634302 ).

I am also attaching a gdb all thread stack trace dump. And based on a look at this strace a procfs info for the process file descriptors.

I also saved a core dump of the main process. https://www.functor.xyz/factorio/factor ... ump.tar.7z (500MB compressed, 11GB uncompressed).

System is Linux 5.10.28-1, amd64, Debian testing, amdgpu, Mesa 20.3.4 on AMD Radeon R9 Fury X (FIJI). CPU ThreadRipper 2950X, no OC, 128GB (8x16GB) of DDR4 memory (ECC). System uptime 23 days.

PS. I know you might be short on staff, especially Linux, so I am willing to look essentially for free at the source code related to async saving under NDA, if you want. It looks like some sort of deadlock, maybe fork / clone issue. I know Linux, pthread and C++ very well.
Attachments
factorio_hang_proc.txt.gz
(12.06 KiB) Downloaded 62 times
config.ini
(26.22 KiB) Downloaded 68 times
factorio_hang_gdb.txt.gz
(14.92 KiB) Downloaded 65 times
factorio_hang_gdb.txt.gz
(14.92 KiB) Downloaded 67 times
factorio_hang_strace.txt.gz
(41.6 KiB) Downloaded 49 times
factorio-current.log
(113.72 KiB) Downloaded 65 times
Last edited by movax20h on Sun Jun 13, 2021 4:17 am, edited 1 time in total.

Loewchen
Global Moderator
Global Moderator
Posts: 8285
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [1.1.34] Main game hangs at the end of saving

Post by Loewchen »

Non blocking saving is not supported, if it does not work for you, disable it.

movax20h
Fast Inserter
Fast Inserter
Posts: 164
Joined: Fri Mar 08, 2019 7:07 pm
Contact:

Re: [1.1.34] Main game hangs at the end of saving

Post by movax20h »

Loewchen wrote:
Sun Jun 13, 2021 4:07 am
Non blocking saving is not supported, if it does not work for you, disable it.
I know it is not supported, there is some bug somewhere. But I really love this feature, and would like to help fixing it. Also this is the first time it didn't work for me, so that is weird.

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: [1.1.34] Main game hangs at the end of saving

Post by disentius »

Loewchen, this is not "not a bug"
Placing it in minor issues seems a better solution to me.

Loewchen
Global Moderator
Global Moderator
Posts: 8285
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [1.1.34] Main game hangs at the end of saving

Post by Loewchen »

movax20h wrote:
Sun Jun 13, 2021 4:09 am
But I really love this feature, and would like to help fixing it.
I understand that, but the decision was made not to spend time trying to fix it.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [1.1.34] Main game hangs at the end of saving

Post by eradicator »

disentius wrote:
Sun Jun 13, 2021 10:46 am
Loewchen, this is not "not a bug"
It's officially unsupported usage. So technically it's the same as saying "Factorio doesn't run on my phone". Even if that feels a bit strange.
movax20h wrote:
Sun Jun 13, 2021 3:41 am
progress bar at 100% [...] can't interact with the game [...] 0% CPU usage.
This might be a bit far fetched, but that is the exact same behavior I see when stdout is blocked before factorio writes the final "Info AppManagerStates.cpp:1942: Saving finished" message to the log (on Windows).
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Not a bug”