Page 1 of 1

[Oxyd] [15.21] kill_all_units() corrupts save causing crash

Posted: Sun Jun 18, 2017 8:07 am
by faraway9912
Game info:

Running on OSX 10.10.5, factorio version 0.15.21, mod list attached.

Steps to reproduce:
* Load attached save.
* Enter into the console "/c game.forces.enemy.kill_all_units()".
* Save game
* Reload, or restart and reload.
* Observe crash logs as attached.

It seems this is due to running Pathfinding() on a zero-length list of biters ... maybe?

I've run "for key, entity in pairs(game.player.surface.find_entities_filtered({area={{96, -768}, {384, 0}}, force= "enemy"})) do
entity.destroy()
end" in the console with no save corruption.

Re: [15.21] kill_all_units() corrupts save causing crash

Posted: Sun Jun 18, 2017 8:13 am
by faraway9912
If you guys are having trouble reproing I'll try to find a base game crash as well. I suspect just disabling all the mods in this save would do it.

Re: [15.21] kill_all_units() corrupts save causing crash

Posted: Mon Jun 19, 2017 12:44 pm
by Klonan
faraway9912 wrote:If you guys are having trouble reproing I'll try to find a base game crash as well. I suspect just disabling all the mods in this save would do it.
If you can narrow down exactly which mod is contributing the issue it would really help

Re: [Oxyd] [15.21] kill_all_units() corrupts save causing crash

Posted: Mon Jun 19, 2017 2:07 pm
by Oxyd
At least post your mod folder, please. Since it doesn't crash in vanilla, there isn't much I can do for you without the necessary mods.

Re: [Oxyd] [15.21] kill_all_units() corrupts save causing crash

Posted: Wed Jun 21, 2017 5:47 pm
by faraway9912
Hi,

Sorry for the delay.

I did some testing and managed to repro on base game. Saves attached. Same repro mechanism (type `game.forces.enemy.kill_all_units()` after loading up _precrash).

It's probably not hard to cook up a minimal crashing example either. How I would do it:
* start up a base that produces some pollution
* trigger a biter attack
* set peaceful mode to on, either using the console, or using creative mode button
* save
* kill_all_units()
* save <- this save probably crashes.

Re: [Oxyd] [15.21] kill_all_units() corrupts save causing crash

Posted: Fri Jun 23, 2017 7:27 pm
by Rseding91
I've been trying to reproduce the problem on a fresh save file but so far haven't been able to.

Are you able to reproduce the problem on a new save file?

Re: [Oxyd] [15.21] kill_all_units() corrupts save causing crash

Posted: Thu Jun 29, 2017 1:14 pm
by Oxyd
Same here, can't reproduce. Your precrash save is already in an invalid state, so what I would really like to know is how that happened. Just triggerring an attack, switching to peaceful and doing kill_all_units does not do it for me.