[0.17.11] Crash when assigning game_view_settings to non-LuaObject

This subforum contains all the issues which we already resolved.
Boodals
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

[0.17.11] Crash when assigning game_view_settings to non-LuaObject

Post by Boodals »

The game crashes when running the following command:
/c game.player.game_view_settings = game

I looked into it with my source access. Anything that uses LuaHelper::parseLuaObject will crash if you pass an object that isnt a LuaObject, but can be accessed from Lua, such as LuaGameScript. It passes all checks in parseLuaObject, so gets cast into a LuaObject*, but then trying to do anything to it crashes.
Not many things actually use that function, so it's pretty rare.

Code: Select all

 601.647 Player 0 ran command: game.player.game_view_settings = game
Factorio crashed. Generating symbolized stacktrace, please wait ...
g:\factorio dev\factorio\libraries\stackwalker\stackwalker.cpp (924): StackWalker::ShowCallstack
g:\factorio dev\factorio\src\util\logger.cpp (415): Logger::writeStacktrace
g:\factorio dev\factorio\src\util\logger.cpp (566): Logger::logStacktrace
g:\factorio dev\factorio\src\util\logging.cpp (89): Logging::logAndAbortOrThrow
g:\factorio dev\factorio\src\util\logging.cpp (83): Logging::logAndAbortOrThrow
g:\factorio dev\factorio\src\util\luaexceptionhelper.cpp (65): LuaExceptionHelper::LogAndAbort
g:\factorio dev\factorio\src\script\luabinder.hpp (355): `LuaBinder<LuaAccumulatorControlBehavior>::callWrapper'::`1'::catch$1
f:\dd\vctools\crt\vcruntime\src\eh\amd64\handlers.asm (50): _CallSettingFrame
f:\dd\vctools\crt\vcruntime\src\eh\frame.cpp (1528): __FrameHandler3::CxxCallCatchBlock
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF08024453)
00007FFF08024453 (ntdll): (filename not available): RtlCaptureContext
g:\factorio dev\factorio\src\script\luabinder.hpp (341): LuaBinder<LuaAccumulatorControlBehavior>::callWrapper
g:\factorio dev\factorio\libraries\lua\ldo.c (319): luaD_precall
g:\factorio dev\factorio\libraries\lua\ldo.c (392): luaD_call
g:\factorio dev\factorio\libraries\lua\lvm.c (104): callTM
g:\factorio dev\factorio\libraries\lua\lvm.c (168): luaV_settable
g:\factorio dev\factorio\libraries\lua\lvm.c (601): luaV_execute
g:\factorio dev\factorio\libraries\lua\lapi.c (1027): f_call
g:\factorio dev\factorio\libraries\lua\ldo.c (131): luaD_rawrunprotected
g:\factorio dev\factorio\libraries\lua\ldo.c (590): luaD_pcall
g:\factorio dev\factorio\src\script\luagamescript.cpp (1340): LuaGameScript::runLuaCommand
g:\factorio dev\factorio\src\script\luacontext.cpp (226): LuaContext::runLuaCommand
g:\factorio dev\factorio\src\commandprocessor.cpp (1443): CommandProcessor::doExecuteCommand
g:\factorio dev\factorio\src\commandprocessor.cpp (297): CommandProcessor::executeCommand
g:\factorio dev\factorio\src\commandprocessor.cpp (244): CommandProcessor::process
g:\factorio dev\factorio\src\gameactionhandler.cpp (3523): GameActionHandler::writeToConsole
g:\factorio dev\factorio\src\gameactionhandler.cpp (324): GameActionHandler::actionPerformed
g:\factorio dev\factorio\src\input\inputhandler.cpp (61): InputHandler::flushActions
g:\factorio dev\factorio\src\gameactionhandler.cpp (364): GameActionHandler::update
g:\factorio dev\factorio\src\mainloop.cpp (1094): MainLoop::gameUpdateStep
g:\factorio dev\factorio\src\mainloop.cpp (967): MainLoop::gameUpdateLoop
g:\factorio dev\factorio\src\util\workerthread.cpp (42): WorkerThread::loop
c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.15.26726\include\thr\xthread (230): std::_LaunchPad<std::unique_ptr<std::tuple<void (__cdecl*)(ParallelScenarioSaver *),ParallelScenarioSaver *>,std::default_delete<std::tuple<void (__cdecl*)(ParallelScenarioSaver *),ParallelScenarioSaver *> > > >::_Go
c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.15.26726\include\thr\xthread (209): std::_Pad::_Call_func
minkernel\crts\ucrt\src\appcrt\startup\thread.cpp (115): thread_start<unsigned int (__cdecl*)(void * __ptr64)>
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF06131FE4)
00007FFF06131FE4 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF07FECB81)
00007FFF07FECB81 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
 602.148 Error LuaExceptionHelper.cpp:65: Unexpected error: Access violation - no RTTI data!
Logger::writeStacktrace skipped.
 602.148 Error CrashHandler.cpp:174: Map tick at moment of crash: 33315
 602.148 Error Util.cpp:97: 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.
 603.346 Uploading log file
 603.366 Error CrashHandler.cpp:221: Heap validation: success.
 603.367 Creating crash dump.
 603.456 CrashDump success
Rseding91
Factorio Staff
Factorio Staff
Posts: 14339
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.11] Crash when assigning game_view_settings to non-LuaObject

Post by Rseding91 »

Thanks for the report. It's now fixed for the next version of 0.17.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”