[0.16.35] Factorio deadlocks ingame, SP, no mods

Place for things which are bugs but we have no idea how to solve them. Things related to hardware, libraries, strange setups, etc.
Post Reply
luziferius
Inserter
Inserter
Posts: 35
Joined: Thu Jun 01, 2017 12:59 pm
Contact:

[0.16.35] Factorio deadlocks ingame, SP, no mods

Post by luziferius »

Well,
This might be 1/0 magic…
I got a deadlock. Rendering stops. Simulation stops (CPU load drops to 13% of a single core.). Autosaves stop being saved.

It now happened the second time, the first time was several versions ago, but I don’t remember which 0.16.x version that was.

After I got the deadlock, I attached gdb to the factorio PID and dumped backtraces using thread apply all bt, included in gdb.txt

(I needed 2 attempts to attach gdb to factorio. During the first attempt, gdb hang after running attach. I hope that killing gdb and then attaching another instance did not destroy the gathered backtraces.)

If this deadlock happens again, what can I do to produce more useful debug output?
log
Backtraces generated using gdb
Attachments
factorio-current.log
Notice the time difference between last autosave and quit.
(4.58 KiB) Downloaded 108 times
gdb.txt
(gdb) thread apply all bt
(11 KiB) Downloaded 100 times

kitcat
Long Handed Inserter
Long Handed Inserter
Posts: 66
Joined: Wed Apr 26, 2017 3:11 pm
Contact:

Re: [0.16.35] Factorio deadlocks ingame, SP, no mods

Post by kitcat »

Tried running Factorio without Steam?

luziferius
Inserter
Inserter
Posts: 35
Joined: Thu Jun 01, 2017 12:59 pm
Contact:

Re: [0.16.35] Factorio deadlocks ingame, SP, no mods

Post by luziferius »

This does not happen often and I have not found any reproduction steps.
The steam version runs fine for days worth of play time, so its not that I can't play because of this.

I thougth about it a bit more: It might be a lock in the graphics driver caused by
some weird interactions between Factorio, the nvidia linux driver, maybe my lowlatency kernel and the Steam game overlay.

What happens to a singleplayer game when the render thread(s) deadlock? Does the simulation still advance or does it stall?

I'd like to try that, so how can I deliberately stall the render thread?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13202
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.35] Factorio deadlocks ingame, SP, no mods

Post by Rseding91 »

luziferius wrote:What happens to a singleplayer game when the render thread(s) deadlock? Does the simulation still advance or does it stall?

I'd like to try that, so how can I deliberately stall the render thread?
It depends what part: if the prepare step locks then the entire program will pause waiting for it. If the render thread (send draw calls to the GPU) locks then the game keeps updating in the background.
If you want to get ahold of me I'm almost always on Discord.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13202
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.35] Factorio deadlocks ingame, SP, no mods

Post by Rseding91 »

Based off your comments and having no way to reproduce this I'm going to move it to 0/1 magic.
If you want to get ahold of me I'm almost always on Discord.

luziferius
Inserter
Inserter
Posts: 35
Joined: Thu Jun 01, 2017 12:59 pm
Contact:

Re: [0.16.35] Factorio deadlocks ingame, SP, no mods

Post by luziferius »

I hope that this will resolve itself when the renderer rewrite hits in 0.17.

When only render deadlocks, then the game should therefore continue doing autosaves. Since that stopped (huge time diff in log without saves), I conclude it was the prepare step.

If this happens again, would a full memory dump be helpful?

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

Re: [0.16.35] Factorio deadlocks ingame, SP, no mods

Post by eradicator »

Factorio stops when the stdout is blocked and it tries to save. This is easily reproducable by starting factorio from console on windows and then selecting some text. I never considered this a bug but it at least somewhat fits the pattern you describe: "doesn't save" and "cpu usage drops", though cpu usage drops to nearly 0 for me in that case. (I use this to stop factorio from using cpu without having to restart it, sort of a factorio built-in "hybernate" function. Because even in menus/pause mode it consumes lots and lots of tasty cpu cycles and heats up my laptop.)

Post Reply

Return to “1 / 0 magic”