Page 1 of 1

[Rseding91] [0.16.0] Crash on autosave

Posted: Wed Dec 13, 2017 6:49 pm
by I_IBlackI_I
What did I expect to happen
Game would go back to main menu and tell me which GUI element is incorrect.
What actually happened
Game crashed to desktop.

Code: Select all

 446.003 Info AppManager.cpp:263: Saving to _autosave1 (blocking).
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-uxeipb\libraries\stackwalker\stackwalker.cpp (923): StackWalker::ShowCallstack
c:\cygwin64\tmp\factorio-uxeipb\src\util\logger.cpp (371): Logger::writeStacktrace
c:\cygwin64\tmp\factorio-uxeipb\src\util\logger.cpp (470): Logger::logStacktrace
c:\cygwin64\tmp\factorio-uxeipb\src\util\logging.cpp (78): Logging::logAndAbortOrThrow
c:\cygwin64\tmp\factorio-uxeipb\src\util\logging.cpp (73): Logging::logAndAbortOrThrow
c:\cygwin64\tmp\factorio-uxeipb\src\gui\style\stylespecification.cpp (273): StyleSpecification::save
c:\cygwin64\tmp\factorio-uxeipb\src\gui\style\horizontalflowstylespecification.cpp (48): HorizontalFlowStyleSpecification::save
c:\cygwin64\tmp\factorio-uxeipb\src\customgui\customguielement.cpp (237): CustomGuiElement::save
c:\cygwin64\tmp\factorio-uxeipb\src\customgui\customflow.cpp (37): CustomFlow::save
c:\cygwin64\tmp\factorio-uxeipb\src\customgui\customguielement.cpp (237): CustomGuiElement::save
c:\cygwin64\tmp\factorio-uxeipb\src\customgui\customgui.cpp (150): CustomGui::save
c:\cygwin64\tmp\factorio-uxeipb\src\player.cpp (287): Player::save
c:\cygwin64\tmp\factorio-uxeipb\src\map\map.cpp (1159): Map::save
c:\cygwin64\tmp\factorio-uxeipb\src\scenario\scenario.cpp (624): Scenario::saveMap
c:\cygwin64\tmp\factorio-uxeipb\src\scenario\scenario.cpp (551): Scenario::saveAs
c:\cygwin64\tmp\factorio-uxeipb\src\scenario\parallelscenariosaver.cpp (92): ParallelScenarioSaver::doSave
c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.12.25827\include\thr\xthread (232): std::_LaunchPad<std::unique_ptr<std::tuple<void (__cdecl*)(ParallelDesyncReportCreator * __ptr64),ParallelDesyncReportCreator * __ptr64>,std::default_delete<std::tuple<void (__cdecl*)(ParallelDesyncReportCreator * __ptr64),ParallelDesyncReportCreator * __ptr64> > > >::_Go
c:\program files (x86)\microsoft visual studio\2017\community\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: 00007FFDD5241FE4)
00007FFDD5241FE4 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFDD596EF91)
00007FFDD596EF91 (ntdll): (filename not available): RtlUserThreadStart
 448.778 Error StyleSpecification.cpp:273: Attempting to save style with no parent that isn't a root - this will cause a desync on loading.
Logger::writeStacktrace skipped.
 448.778 Error CrashHandler.cpp:128: Map tick at moment of crash: 18001
 448.778 Error Util.cpp:67: Unexpected error occurred. If you're running the latest version of the game you can help us solve the problem by posting the contents of the log file on the Factorio forums.
Please also include the save file(s), any mods you may be using, and any steps you know of to reproduce the crash.
 455.381 Creating crash dump.
 455.727 CrashDump success

Re: [Rseding91] [0.16.0] Crash on autosave

Posted: Wed Dec 13, 2017 8:17 pm
by I_IBlackI_I
When running certain code from the Lua Scenario this will cause the crash, the minimum amount of code required as a command:

Code: Select all

/c local p = game.player
bf = mod_gui.get_button_flow(p)
tg = bf.add {name = "topgui", type = "flow", direction = "horizontal", style = "slot_table_spacing_flow"}


The cause of the game erroring out is the following:
The style definitions in /core/prototypes/style.lua got renamed and flow got seperated into two seperate styles HorizontalFlow and VeritcalFlow.
Trying to set a wrong type of Flow(style) to the LuaGuiElement causes the game to not assign (but not log it)the style but crash on autosave

Re: [Rseding91] [0.16.0] Crash on autosave

Posted: Wed Dec 13, 2017 8:22 pm
by I_IBlackI_I
Here is a scenario which will cause it to crash on autosave. The relevant line for applying a wrong style can be found in /lualib/topgui:95

It is recommended to turn the autosave frequency down, and increase game speed to reach point of autosave faster.

Re: [Rseding91] [0.16.0] Crash on autosave

Posted: Wed Dec 13, 2017 8:29 pm
by Rseding91
Thanks for the report. I've found the problem and it will be fixed for 0.16.2. 16.1 is already in process of running.