Code: Select all
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-build-rlyqnq\libraries\stackwalker\stackwalker.cpp (924): StackWalker::ShowCallstack
c:\cygwin64\tmp\factorio-build-rlyqnq\src\util\logger.cpp (408): Logger::writeStacktrace
c:\cygwin64\tmp\factorio-build-rlyqnq\src\util\logger.cpp (521): Logger::logStacktrace
c:\cygwin64\tmp\factorio-build-rlyqnq\src\util\logging.cpp (89): Logging::logAndAbortOrThrow
c:\cygwin64\tmp\factorio-build-rlyqnq\src\util\logging.cpp (83): Logging::logAndAbortOrThrow
c:\cygwin64\tmp\factorio-build-rlyqnq\src\script\luatrain.cpp (77): LuaTrain::LuaTrain
c:\cygwin64\tmp\factorio-build-rlyqnq\src\script\luaentity.cpp (4130): LuaEntity::luaGetTrainStopTrains
c:\cygwin64\tmp\factorio-build-rlyqnq\src\script\luabinder.hpp (326): LuaBinder<LuaLogisticPoint>::callWrapper
c:\cygwin64\tmp\factorio-build-rlyqnq\libraries\lua\ldo.c (319): luaD_precall
c:\cygwin64\tmp\factorio-build-rlyqnq\libraries\lua\lvm.c (710): luaV_execute
c:\cygwin64\tmp\factorio-build-rlyqnq\libraries\lua\lapi.c (1018): f_call
c:\cygwin64\tmp\factorio-build-rlyqnq\libraries\lua\ldo.c (131): luaD_rawrunprotected
c:\cygwin64\tmp\factorio-build-rlyqnq\libraries\lua\ldo.c (590): luaD_pcall
c:\cygwin64\tmp\factorio-build-rlyqnq\src\script\luagamescript.cpp (4362): LuaGameScript::signallingPCall
c:\cygwin64\tmp\factorio-build-rlyqnq\src\script\luagamescript.cpp (796): LuaGameScript::runNthTickHandler
c:\cygwin64\tmp\factorio-build-rlyqnq\src\script\luaeventdispatcher.cpp (148): LuaEventDispatcher::dispatch
c:\cygwin64\tmp\factorio-build-rlyqnq\src\scenario\scenario.cpp (880): Scenario::update
c:\cygwin64\tmp\factorio-build-rlyqnq\src\mainloop.cpp (1007): MainLoop::gameUpdateStep
c:\cygwin64\tmp\factorio-build-rlyqnq\src\mainloop.cpp (874): MainLoop::gameUpdateLoop
c:\cygwin64\tmp\factorio-build-rlyqnq\src\util\workerthread.cpp (36): WorkerThread::loop
c:\program files (x86)\microsoft visual studio\2017\buildtools\vc\tools\msvc\14.12.25827\include\thr\xthread (232): std::_LaunchPad<std::unique_ptr<std::tuple<void (__cdecl RouterBase::*)(void) __ptr64,ServerRouter * __ptr64>,std::default_delete<std::tuple<void (__cdecl RouterBase::*)(void) __ptr64,ServerRouter * __ptr64> > > >::_Go
c:\program files (x86)\microsoft visual studio\2017\buildtools\vc\tools\msvc\14.12.25827\include\thr\xthread (211): std::_Pad::_Call_func
d:\th\minkernel\crts\ucrt\src\appcrt\startup\thread.cpp (115): thread_start<unsigned int (__cdecl*)(void * __ptr64)>
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFADD4D3034)
00007FFADD4D3034 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFADDA41431)
00007FFADDA41431 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
31.209 Error LuaTrain.cpp:77: Invalid state for train.
Logger::writeStacktrace skipped.
31.209 Error CrashHandler.cpp:174: Map tick at moment of crash: 18530
The crash is triggered by this line https://github.com/shanemadden/factorio ... .lua#L1037 (verified by adding log() calls - simply trying to print get_train_stop_trains() causes the crash) in cases where the locomotive destroy()'ed on line 991 had that station in its train's schedule prior to the event handler firing.
I've worked around letting this unintentionally crash users' games in the current version of the mod by just clearing the schedule from this train in the case where it might have picked one up, but manually adding the stop to the schedule during the train's construction process will still trigger the crash.
The attached save is set up to crash a few seconds after being loaded (just sync mods first) - the train currently under construction in the save has had the test station added to its schedule by hand, which triggers the crash as the train finishes construction (the orange builder locomotive is destroyed then the get_train_stop_trains() call triggers the crash).