Page 1 of 1

[0.12.20] [kovarex] Eventual crash in inserter::update() (via mods)

Posted: Wed Dec 30, 2015 1:09 am
by Cloaked
I'm making a mod that involves using the inserter type for a non-inserter purpose (they can be both rotated and connected to the circuit network; didn't go digging too far to figure out if something besides an inserter would work).

I had code that sets active= false in on_built_entity() (with the idea that that would turn off the inserter-ness of the entity), but that eventually causes a crash. It seems to occur when I kill that entity within a roboport range and it is being replaced, but the timing is inconsistent. I've fiddled with the prototype of my inserter entity until it was back to being equal to the vanilla smart inserter, but the crash didn't stop happening until I removed the code that set active = false.

Callstack:

Factorio crashed. Generating symbolized stacktrace, please wait ...
#0 0x7fff98160f1a in 0x7fff98160f1a
#1 0x0 in 0x0
#2 0x100143fff in Inserter::update() (in factorio) + 1919
#3 0x1003f2143 in Chunk::update(unsigned int, Surface&) (in factorio) + 307
#4 0x1003f7570 in Surface::update() (in factorio) + 400
#5 0x1001e0dbd in Map::update() (in factorio) + 717
#6 0x1001e0981 in Game::update() (in factorio) + 49
#7 0x10032dc23 in Scenario::update() (in factorio) + 979
#8 0x10032d49a in MainLoop::gameUpdateStep(MultiplayerManager*, Scenario*, AppManager*) (in factorio) + 346
#9 0x10032e300 in MainLoop::updateLoop(ThreadBarrier*, boost::chrono::time_point<boost::chrono::steady_clock, boost::chrono::duration<long long, boost::ratio<1l, 1000000000l> > >*, boost::chrono::time_point<boost::chrono::steady_clock, boost::chrono::duration<long long, boost::ratio<1l, 1000000000l> > >*, bool*, bool) (in factorio) + 320
#10 0x1004564fe in Thread::loop() (in factorio) + 254
#11 0x1009212f6 in boost::(anonymous namespace)::thread_proxy(void*) (in factorio) + 54
#12 0x7fff95c19268 in 0x7fff95c19268
#13 0x7fff95c191e5 in 0x7fff95c191e5

Other info:
0.000 2015-12-29 16:26:16; Factorio 0.12.20 (Build 17489, mac)
0.000 Operating system: Mac OS X 10.10.3
0.000 Program arguments: "/Applications/factorio.app"
0.017 Available display adapters: 1
0.017 [0]: resolution 1440x900px at [0,0]
0.017 Create display on adapter 0. Size 1280x720 at position [70, 72]. Monitor 0
0.132 Initialised OpenGL:[0] Intel HD Graphics 3000 OpenGL Engine; driver: 2.1 INTEL-10.0.31
0.546 Graphics options: [FullScreen: false] [VSync: true] [UIScale: 100%] [MultiSampling: OFF] [Graphics quality: low] [Video memory usage: low] [Light scale: 20%] [Screen: 255]
0.627 Loading mod core 0.0.0 (data.lua)
0.632 Loading mod base 0.12.20 (data.lua)
0.749 Loading mod bobconfig 0.12.2 (data.lua)
0.815 Loading mod boblibrary 0.12.3 (data.lua)
0.886 Loading mod circuitteleportation 0.0.1 (data.lua)
0.955 Loading mod FARL 0.4.41 (data.lua)
1.023 Loading mod MoreLight 1.0.0 (data.lua)
1.100 Loading mod test-mode 0.12.11 (data.lua)
1.165 Loading mod tree_collision 0.2.0 (data.lua)
1.227 Loading mod bobassembly 0.12.7 (data.lua)
1.310 Loading mod bobenemies 0.12.6 (data.lua)
1.386 Loading mod bobores 0.12.7 (data.lua)
1.479 Loading mod bobtech 0.12.4 (data.lua)
1.576 Loading mod bobplates 0.12.10 (data.lua)
1.691 Loading mod bobelectronics 0.12.6 (data.lua)
1.798 Loading mod boblogistics 0.12.7 (data.lua)
1.952 Loading mod bobmining 0.12.3 (data.lua)
2.072 Loading mod bobpower 0.12.6 (data.lua)
2.214 Loading mod bobwarfare 0.12.9 (data.lua)
2.380 Loading mod bobmodules 0.12.9 (data.lua)
2.571 Loading mod bobconfig 0.12.2 (data-updates.lua)
2.725 Loading mod FARL 0.4.41 (data-updates.lua)
2.908 Loading mod test-mode 0.12.11 (data-updates.lua)
3.066 Loading mod bobassembly 0.12.7 (data-updates.lua)
3.227 Loading mod bobenemies 0.12.6 (data-updates.lua)
3.404 Loading mod bobores 0.12.7 (data-updates.lua)
3.560 Loading mod bobtech 0.12.4 (data-updates.lua)
3.752 Loading mod rso-mod 1.4.6 (data-updates.lua)
3.908 Loading mod bobplates 0.12.10 (data-updates.lua)
4.074 Loading mod bobelectronics 0.12.6 (data-updates.lua)
4.237 Loading mod boblogistics 0.12.7 (data-updates.lua)
4.442 Loading mod bobmining 0.12.3 (data-updates.lua)
4.595 Loading mod bobpower 0.12.6 (data-updates.lua)
4.757 Loading mod bobwarfare 0.12.9 (data-updates.lua)
4.945 Loading mod bobmodules 0.12.9 (data-updates.lua)
5.117 Loading mod test-mode 0.12.11 (data-final-fixes.lua)
5.288 Loading mod bobelectronics 0.12.6 (data-final-fixes.lua)
7.069 Initial atlas bitmap size is 8192
7.069 Created atlas bitmap 8192x94

Re: Eventual crash in inserter::update() (via mods)

Posted: Wed Dec 30, 2015 9:26 am
by kovarex
Could you post the minimal case mod that reproduces it?

Re: [0.12.20] [kovarex] Eventual crash in inserter::update() (via mods)

Posted: Mon Jan 04, 2016 6:02 pm
by kovarex
Thanks for the report, I managed to reproduce and fix it for 0.12.21