[0.12.20] [kovarex] Odd crash involving belts

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
ludsoe
Fast Inserter
Fast Inserter
Posts: 243
Joined: Tue Feb 11, 2014 8:16 am
Contact:

[0.12.20] [kovarex] Odd crash involving belts

Post by ludsoe »

So while developing Mining Robots for MoMining, Ive ran into a odd quirk involving belts and manually spawning item stacks. And it just causes the game to crash, with the logs pointing to the itself erroring out.
However I was able to work around it and forgot to setup a bug report when i discovered it. (Now it comes back during the all time low of bug reports.... :twisted: )
(Those of you who have MoMining installed, don't worry the version used in this bug report is modified to have its safety's disabled. You wont crash to this error.)
Factorio Log....
Heres a link to the mod/save to replicate the crash.
Download: http://www.mediafire.com/download/ch4bx ... tcrash.zip

How to replicate:
Install the mod, and then load the save.
After the game is loaded there should be a mining robotics port entity next to the player, which uses the sprite of a furnace.
Place a stack of construction robots into it, and the game should immediately crash.

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

Re: [0.12.20] Odd crash involving belts

Post by Rseding91 »

You describe how to make it crash but you didn't describe how you got the transport belts and the item stacks to interact weirdly :)

Could you describe that part? That's going to be where the fix comes in.
If you want to get ahold of me I'm almost always on Discord.

User avatar
ludsoe
Fast Inserter
Fast Inserter
Posts: 243
Joined: Tue Feb 11, 2014 8:16 am
Contact:

Re: [0.12.20] Odd crash involving belts

Post by ludsoe »

Well based on my observations it seems to involve newly spawned item stacks trying to fit on a belt entity that's currently completely full.
Exactly what I do

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: [0.12.20] Odd crash involving belts

Post by prg »

Simple way to reproduce without mods: run

Code: Select all

game.player.surface.create_entity{name="basic-transport-belt", position=game.player.position}
game.player.surface.create_entity{name="item-on-ground", position=game.player.position, stack={name="iron-plate"}}.order_deconstruction(game.player.force)
and save the game. Might not crash immediately, but repeat it a couple of times and you'll get

Code: Select all

   0.000 2015-12-12 14:16:49; Factorio 0.12.20 (Build 17489, linux64)
   0.000 Operating system: Linux
   0.000 Program arguments: "./factorio" 
   0.000 Read data path: /home/prg/Downloads/factorio/data
   0.000 Write data path: /home/prg/Downloads/factorio
   0.000 Binaries path: /home/prg/Downloads/factorio/bin
   0.048 Available display adapters: 2
   0.048  [0]: resolution 1280x1024px at [0,0]
   0.048  [1]: resolution 1024x768px at [1280,0]
   0.048 Create display on adapter 1. Size 1280x720 at position [0, 134]. Monitor 0
   0.113 Initialised OpenGL:[1] GeForce GTX 660/PCIe/SSE2; driver: 4.5.0 NVIDIA 358.16
   0.140 Graphics options: [FullScreen: false] [VSync: false] [UIScale: 100%] [MultiSampling: OFF] [Graphics quality: normal] [Video memory usage: all] [Light scale: 100%] [Screen: 255]
   0.164 Loading mod core 0.0.0 (data.lua)
   0.165 Loading mod base 0.12.20 (data.lua)
   0.515 Initial atlas bitmap size is 16384
   0.517 Created atlas bitmap 16384x7759
   5.863 Factorio initialised
  11.460 Info Scenario.cpp:123: Map version 0.12.20-1
  21.348 Verbose Scenario.cpp:514: Saving game as /home/prg/Downloads/factorio/saves/crashme
  24.691 Verbose Scenario.cpp:514: Saving game as /home/prg/Downloads/factorio/saves/crashme
  30.519 Verbose Scenario.cpp:514: Saving game as /home/prg/Downloads/factorio/saves/crashme
  36.071 Verbose Scenario.cpp:514: Saving game as /home/prg/Downloads/factorio/saves/crashme
  36.515 Warning Logger.cpp:316: Symbols.size() == 20, usedSize == 8
Factorio crashed. Generating symbolized stacktrace, please wait ...
  36.884 Warning Logger.cpp:316: Symbols.size() == 19, usedSize == 7
#0  0x7f625533e440 in ?? at ??:0
#1  0x669b41 in ForceData::preSaveHook(MapSerialiser&) const [clone .constprop.54692] at /tmp/factorio-ZIIOVU/src/Util/Targetable.cpp:90
#2  0x9612b6 in TargeterBase::TargeterBase(Targetable*) at /tmp/factorio-ZIIOVU/src/Util/Targeter.cpp:14
#3  0x9624ff in Targeter<Entity>::Targeter(Entity*) at /tmp/factorio-ZIIOVU/src/Util/Targeter.hpp:68
#4  0xd4144f in DeconstructionOrderItem::DeconstructionOrderItem(DeconstructionOrder const&) at /tmp/factorio-ZIIOVU/src/Logistics/LogisticSaveLoadHelper.hpp:90
#5  0x7f6256f27324 in construct<DeconstructionOrderItem, const DeconstructionOrder&> at /usr/include/c++/5/ext/new_allocator.h:120
#6  0x7f62553f31cd in _S_construct<DeconstructionOrderItem, const DeconstructionOrder&> at /usr/include/c++/5/bits/alloc_traits.h:256
  36.884 Error Util.cpp:63: Unexpected error occurred. You can help us to solve the problem by posting the contents of the log file on the Factorio forums.
  37.356 Warning Logger.cpp:316: Symbols.size() == 12, usedSize == 9
Factorio crashed. Generating symbolized stacktrace, please wait ...
  37.744 Warning Logger.cpp:316: Symbols.size() == 11, usedSize == 8
#0  0x7f625533e440 in ?? at ??:0
#1  0x626ce8 in ControlInput::Value::checkModifiers(InputState const&) at /tmp/factorio-ZIIOVU/src/Input/ControlInput.cpp:437
#2  0x6f7185 in ControlInput::Value::triggeredBy(ALLEGRO_EVENT const&, InputState const&, bool, bool) at /tmp/factorio-ZIIOVU/src/Input/ControlInput.cpp:370
#3  0xa16fc9 in MainLoop::processAllegroEvents(bool) at /tmp/factorio-ZIIOVU/src/Input/AppInputListener.cpp:10
#4  0xa349ce in processAllegroEvent at /tmp/factorio-ZIIOVU/src/MainLoop.cpp:123
#5  0xa8806e in processAllegroEvents at /tmp/factorio-ZIIOVU/src/MainLoop.cpp:169
#6  0x7f625532b7b0 in MainLoop::run(boost::filesystem::path const&, boost::filesystem::path const&, bool, bool, std::string const&) [clone .constprop.51658] at /tmp/factorio-ZIIOVU/src/MainLoop.cpp:445
#7  0x40a379 in run at /tmp/factorio-ZIIOVU/src/MainLoop.cpp:566
  37.744 Error Util.cpp:63: Unexpected error occurred. You can help us to solve the problem by posting the contents of the log file on the Factorio forums.
(this even seems to have crashed twice)

The backtrace looks different, but it seems to have the same cause: ordering deconstruction of an item-on-ground created on a transport belt.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

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

Re: [0.12.20] Odd crash involving belts

Post by Rseding91 »

Ahhh I see what the problem is :)

The transport belt is destroying the item entity because it absorbed it. However, the API is also letting you call mark for deconstruction after it has been destroyed.
If you want to get ahold of me I'm almost always on Discord.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.20] [kovarex] Odd crash involving belts

Post by kovarex »

Thanks for the report, it is fixed now in 0.12.21.

The LuaEntity object is now properly invalidated when "consumed" by the belt.

Post Reply

Return to “Resolved Problems and Bugs”