Page 1 of 1

[2.0.57] Consistent crash with new get_logistic_group() and accessing a detached owner

Posted: Sun Jun 22, 2025 10:30 pm
by silverd
I am on Linux standalone, 2.0.57

Game crashes when accessing LuaLogisticSection::owner after it's detached from the player, despite "valid" returning true

Steps to reproduce:
  • Create a Logistic Section on your player character and name it "Test"
  • Now enter Editor Mode, and open the console
  • Run /sc local lg = game.forces.player.get_logistic_group("Test") if lg and lg.members[1] then local lgs = lg.members[1] if lgs and lgs.valid then game.print(lgs.owner) end end
This should crash the game
factorio-current.log
Crash log
(28.89 KiB) Downloaded 25 times

Re: [2.0.57] Consistent crash with new get_logistic_group() and accessing a detached owner

Posted: Sun Jun 22, 2025 10:39 pm
by Loewchen
Post the log of the crash please, see 3638.

Re: [2.0.57] Consistent crash with new get_logistic_group() and accessing a detached owner

Posted: Mon Jun 23, 2025 10:16 am
by boskid
This gets slightly uncomfortable because LuaLogisticSection exposes owner which may be detached. I was thinking between making LuaLogisticSection.owner able of returning nil entity in that specific case but that could be considered a breaking change, so i decided to make get_logistic_group() to instead not include members that belong to detached character. Issue is now fixed for 2.0.58.