[0.16.35] crash when printing invalid(?) value from console

Things that has been reported already before.
sparr
Smart Inserter
Smart Inserter
Posts: 1521
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

[0.16.35] crash when printing invalid(?) value from console

Post by sparr »

Code: Select all

  91.934 Player 0 ran command: p=game.player.print
 110.425 Player 0 ran command: p(game.player.selected)
 110.434 Error CrashHandler.cpp:520: Received SIGSEGV
Factorio crashed. Generating symbolized stacktrace, please wait ...
#0  0x0000000100a160b2 in Logger::logStacktrace(StackTraceInfo*) (in factorio) (Logger.cpp:510)
#1  0x0000000100a0382d in CrashHandler::writeStackTrace(CrashHandler::CrashReason) (in factorio) (CrashHandler.cpp:173)
#2  0x0000000100a047e4 in CrashHandler::commonSignalHandler(int) (in factorio) (CrashHandler.cpp:522)
#3  0x0000000100a03759 in CrashHandler::SignalHandler(int) (in factorio) (CrashHandler.cpp:535)
#4  0x00007fffe4f6ab3a in 0x00007fffe4f6ab3a
#5  (nil) in 0x0
#6  0x0000000100cb3277 in LuaBinder<LuaPlayer>::callWrapper(lua_State*) (in factorio) (LuaBinder.hpp:326)
#7  0x0000000100d12358 in luaD_precall(lua_State*, lua_TValue*, int) (in factorio) + 504
#8  0x0000000100d291cd in luaV_execute(lua_State*) (in factorio) + 3789
#9  0x0000000100d127c7 in luaD_call(lua_State*, lua_TValue*, int, int) (in factorio) + 103
#10 0x0000000100d12fbd in luaD_pcall(lua_State*, void (*)(lua_State*, void*), void*, long, long) (in factorio) + 93
#11 0x0000000100d08708 in lua_pcallk(lua_State*, int, int, int, int, int (*)(lua_State*)) (in factorio) + 216
#12 0x000000010089e5c8 in LuaGameScript::runLuaCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) (in factorio) (LuaGameScript.cpp:1215)
#13 0x0000000100889303 in LuaContext::runLuaCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Player*, RemoteInterfaceID const*) (in factorio) (ScopedCallback.hpp:25)
#14 0x000000010010599e in CommandProcessor::doExecuteCommand(CommandSource const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool) (in factorio) (CommandProcessor.cpp:1373)
#15 0x00000001001036dd in CommandProcessor::process(CommandSource const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) (in factorio) (CommandProcessor.cpp:220)
#16 0x00000001003ab02d in GameActionHandler::writeToConsole(InputAction const&, Player*) (in factorio) (GameActionHandler.cpp:3060)
#17 0x000000010039916e in GameActionHandler::actionPerformed(InputAction const&) (in factorio) (GameActionHandler.cpp:266)
#18 0x00000001006c20d6 in InputHandler::flushActions(bool, unsigned int) (in factorio) (InputHandler.cpp:58)
#19 0x00000001003994e2 in GameActionHandler::update() (in factorio) (GameActionHandler.cpp:305)
#20 0x000000010075fdd4 in MainLoop::gameUpdateStep(MultiplayerManagerBase*, Scenario*, AppManager*, MainLoop::HeavyMode) (in factorio) (MainLoop.cpp:937)
#21 0x000000010075dfaa in MainLoop::gameUpdateLoop(MainLoop::HeavyMode) (in factorio) (MainLoop.cpp:870)
#22 0x0000000100a33a84 in WorkerThread::loop() (in factorio) (WorkerThread.cpp:36)
#23 0x0000000100cea06e in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (WorkerThread::*)(), WorkerThread*> >(void*) (in factorio) (thread:354)
#24 0x00007fffe4f7493b in 0x00007fffe4f7493b
#25 0x00007fffe4f74887 in 0x00007fffe4f74887
#26 0x00007fffe4f7408d in 0x00007fffe4f7408d
Stack trace logging done
 112.616 Error CrashHandler.cpp:174: Map tick at moment of crash: 3229
 112.616 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.
 118.242 Uploading log file
 163.095 Received SIGTERM, shutting down
I don't remember what my cursor was pointing at when this happened. I'm running latest 0.16 beta on OSX via Steam.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16299
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.35] crash when printing invalid(?) value from console

Post by Rseding91 »

The top 2 lines of the crash you pasted:

Code: Select all

91.934 Player 0 ran command: p=game.player.print
110.425 Player 0 ran command: p(game.player.selected)
That's not valid to do. Just do game.print(...).
If you want to get ahold of me I'm almost always on Discord.
sparr
Smart Inserter
Smart Inserter
Posts: 1521
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: [0.16.35] crash when printing invalid(?) value from console

Post by sparr »

yeah, there are at least two problems with that code. still, it shouldn't crash the game.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16299
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.35] crash when printing invalid(?) value from console

Post by Rseding91 »

In order to prevent the crash it adds overhead for the entire lua API which I deemed unacceptable and decided that you'll just crash if you write it.
If you want to get ahold of me I'm almost always on Discord.
quyxkh
Smart Inserter
Smart Inserter
Posts: 1036
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: [0.16.35] crash when printing invalid(?) value from console

Post by quyxkh »

Easy workaround: `/c function p(...) return game.player.print(...) end`.

One step up might be

Code: Select all

psd={comment=false,nocode=true}
function gpsl(p,k) return game.player.print(serpent.line(p,k or psd)) end
Post Reply

Return to “Duplicates”