[Lua] Crash on certain script functions

This subforum contains all the issues which we already resolved.
AyrA
Inserter
Inserter
Posts: 37
Joined: Mon Aug 31, 2015 8:00 pm
Contact:

[Lua] Crash on certain script functions

Post by AyrA »

Using any of these lines in the data-final-fixes.lua file will crash your game:

Code: Select all

error() --Crash instantly
data.raw.player.player.crafting_categories = data.raw["recipe-category"] --Crash when opening inventory
data.raw.player.player.crafting_categories = {""} --Crash when opening inventory
When I say "crash" I mean a real crash, where factorio will exit and show a message to copy the log file path and not a regular script error with stack trace.

I assume that error() will simply throw a real exception that Factorio was not prepared to handle. The next two errors are the game not expecting a certain crafting category state. Attempting to set a category that does not exists will result in an error message telling you so, but for some reason, empty strings are allowed.

factorio-current.log after calling error()

Code: Select all

   0.001 2016-09-11 20:02:18; Factorio 0.14.5 (build 24594, win64, alpha)
   0.001 Operating system: Windows 7 Service Pack 1
   0.001 Program arguments: "C:\Users\Administrator\Desktop\Games\Factorio_14\bin\x64\factorio.exe" 
   0.001 Read data path: C:/Users/Administrator/Desktop/Games/Factorio_14/data
   0.001 Write data path: C:/Users/Administrator/Desktop/Games/Factorio_14
   0.001 Binaries path: C:/Users/Administrator/Desktop/Games/Factorio_14/bin
   0.014 Display options: [FullScreen: true] [VSync: false] [UIScale: 100%] [MultiSampling: OFF] [Screen: 1]
   0.016 Available display adapters: 2
   0.016  [0]: \\.\DISPLAY15 - NVIDIA GeForce GTX 570 {0x01, [1920,0], 1680x1050, 32bit, 60Hz}
   0.016  [1]: \\.\DISPLAY16 - NVIDIA GeForce GTX 570 {0000, no details}
   0.016  [2]: \\.\DISPLAY17 - NVIDIA GeForce GTX TITAN Black {0x05, [0,0], 1920x1080, 32bit, 60Hz}
   0.016 Create display on adapter 1. Size 1280x720 at position [310, 162].
   0.830 Initialised Direct3D:[0] NVIDIA GeForce GTX TITAN Black; driver: nvd3dumx.dll 10.18.13.6869
   0.833     Video memory size (dedicated video/dedicated system/shared system/available): 6074/0/5883/3758 MB
   0.866 Device reset internal.
   0.868 Desktop composition is active.
   0.868 Graphics options: [Graphics quality: normal] [Video memory usage: high] [Light scale: 100%] [DXT: auto]
   0.971 Loading mod core 0.0.0 (data.lua)
   0.977 Loading mod base 0.14.5 (data.lua)
   1.101 Loading mod CrashTest 0.0.1 (data-final-fixes.lua)
   1.103 Error CrashHandler.cpp:210: Received SIGSEGV
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-zpibvy\libraries\stackwalker\stackwalker.cpp (906): StackWalker::ShowCallstack
c:\cygwin64\tmp\factorio-zpibvy\src\util\logger.cpp (332): Logger::writeStacktrace
c:\cygwin64\tmp\factorio-zpibvy\src\util\logger.cpp (386): Logger::logStacktrace
c:\cygwin64\tmp\factorio-zpibvy\src\util\crashhandler.cpp (105): CrashHandler::writeStackTrace
c:\cygwin64\tmp\factorio-zpibvy\src\util\crashhandler.cpp (213): CrashHandler::SignalHandler
d:\th\minkernel\crts\ucrt\src\appcrt\misc\exception_filter.cpp (219): _seh_filter_exe
d:\th\minkernel\crts\ucrt\src\appcrt\startup\thread.cpp (117): `thread_start<unsigned int (__cdecl*)(void * __ptr64)>'::`1'::filt$0
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 000000013FF8C774)
000000013FF8C774 (factorio): (filename not available): __C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000076EA8BBD)
0000000076EA8BBD (ntdll): (filename not available): RtlDecodePointer
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000076E9875F)
0000000076E9875F (ntdll): (filename not available): RtlUnwindEx
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000076ECD348)
0000000076ECD348 (ntdll): (filename not available): KiUserExceptionDispatcher
c:\cygwin64\tmp\factorio-zpibvy\src\util\luahelper.cpp (1223): LuaHelper::packageDofile
c:\cygwin64\tmp\factorio-zpibvy\src\data\luadataloader.cpp (82): LuaDataLoader::loadData
c:\cygwin64\tmp\factorio-zpibvy\src\data\modmanager.cpp (277): ModManager::loadMod
c:\cygwin64\tmp\factorio-zpibvy\src\data\modmanager.cpp (217): ModManager::loadModsPhase
c:\cygwin64\tmp\factorio-zpibvy\src\data\modmanager.cpp (171): ModManager::loadData
c:\cygwin64\tmp\factorio-zpibvy\src\globalcontext.cpp (352): GlobalContext::init
c:\cygwin64\tmp\factorio-zpibvy\src\mainloop.cpp (137): MainLoop::run
c:\cygwin64\tmp\factorio-zpibvy\src\main.cpp (741): wmain
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (255): __scrt_common_main_seh
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000076D759ED)
0000000076D759ED (kernel32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000076EAB371)
0000000076EAB371 (ntdll): (filename not available): RtlUserThreadStart
   5.321 Error Util.cpp:77: 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.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [Lua] Crash on certain script functions

Post by kovarex »

Fixed for 0.14.6 (The empty crafting category input not being checked)
Post Reply

Return to “Resolved Problems and Bugs”