Page 1 of 1

[0.11.3] Game crashes on game.findentities with wrong args

Posted: Thu Nov 27, 2014 11:11 am
by Xecutor
Basically I changed game.findentitiesfiltered to game.findentities, and forgot to fix args.
Call like this:

Code: Select all

game.findentities{area={{p.x-1.2,p.y-1.2},{p.x+1.2,p.y+1.2}}}
crashed the game.

Judging from callstack it's unhandled exception.

Re: [0.11.3] Game crashes on game.findentities with wrong ar

Posted: Thu Nov 27, 2014 2:48 pm
by kovarex
Hello, thank you for the report.

That is strange, I get the error as expected. On what system did you try it?
Does it crash when you just write this in the console?

Code: Select all

/c game.findentities{area={{-1, -1}, {1, 1}}}

Re: [0.11.3] Game crashes on game.findentities with wrong ar

Posted: Thu Nov 27, 2014 3:10 pm
by Xecutor
I'm on mac os 10.10.1.
I'll test console tomorrow.

Forgot to mention - that call was made from ontick event.
I reproduced this several times before I figured out what's the problem.
But for some reason mac os displayed crash window only on the first time.
Subsequently the game was just silently closed.

Re: [0.11.3] Game crashes on game.findentities with wrong ar

Posted: Fri Nov 28, 2014 7:21 am
by Xecutor
Ok. It's crashing with console command too.
Here is what was printed in terminal:

Code: Select all

libc++abi.dylib: terminating with uncaught exception of type lua_longjmp*
Here is stack trace:

Code: Select all

* thread #16: tid = 0x34aa8f, 0x00007fff87d2f282 libsystem_kernel.dylib`__pthread_kill + 10, stop reason = signal SIGABRT
  * frame #0: 0x00007fff87d2f282 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff8b8ac4c3 libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x00007fff86156b73 libsystem_c.dylib`abort + 129
    frame #3: 0x00007fff91d59a21 libc++abi.dylib`abort_message + 257
    frame #4: 0x00007fff91d819d1 libc++abi.dylib`default_terminate_handler() + 267
    frame #5: 0x00007fff8a7356db libobjc.A.dylib`_objc_terminate() + 124
    frame #6: 0x00007fff91d7f0a1 libc++abi.dylib`std::__terminate(void (*)()) + 8
    frame #7: 0x00007fff91d7eb30 libc++abi.dylib`__cxa_throw + 121
    frame #8: 0x0000000100617f62 factorio`luaD_throw(lua_State*, int) + 50
    frame #9: 0x0000000100617bfc factorio`luaG_errormsg(lua_State*) + 124
    frame #10: 0x0000000100612f29 factorio`lua_error(lua_State*) + 9
    frame #11: 0x000000010062cbf5 factorio`luaL_error(lua_State*, char const*, ...) + 261
    frame #12: 0x000000010062cca5 factorio`luaL_argerror(lua_State*, int, char const*) + 133
    frame #13: 0x000000010062d5c7 factorio`luaL_checknumber(lua_State*, int) + 119
    frame #14: 0x000000010048db03 factorio`RealPosition LuaHelper::parsePosition<RealPosition>(lua_State*, int) + 195
    frame #15: 0x0000000100350392 factorio`LuaHelper::parseBoundingBox(lua_State*, int) + 242
    frame #16: 0x000000010036e879 factorio`LuaGameScript::luaFindEntities(lua_State*) + 73
    frame #17: 0x000000010050fd50 factorio`LuaBinder<LuaGameScript>::callWrapper(lua_State*) + 64
    frame #18: 0x0000000100618aa2 factorio`luaD_precall(lua_State*, lua_TValue*, int) + 754
    frame #19: 0x0000000100629fc4 factorio`luaV_execute(lua_State*) + 900
    frame #20: 0x0000000100619239 factorio`luaD_call(lua_State*, lua_TValue*, int, int) + 153
    frame #21: 0x00000001006198d9 factorio`luaD_pcall(lua_State*, void (*)(lua_State*, void*), void*, long, long) + 105
    frame #22: 0x0000000100612ae9 factorio`lua_pcallk(lua_State*, int, int, int, int, int (*)(lua_State*)) + 89
    frame #23: 0x00000001003597a5 factorio`LuaGameScript::runLuaCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 85
    frame #24: 0x00000001002be6c5 factorio`LuaContext::runLuaCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 37
    frame #25: 0x0000000100099cf1 factorio`CommandProcessor::executeCommand(Map&, Player*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 897
    frame #26: 0x000000010009a686 factorio`CommandProcessor::process(Map&, Player*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) + 518
    frame #27: 0x00000001001df9be factorio`GameActionHandler::writeToConsole(InputAction const&, Player*) + 46
    frame #28: 0x00000001001d71d8 factorio`GameActionHandler::actionPerformed(InputAction const&) + 392
    frame #29: 0x00000001002c9eac factorio`InputHandler::nextTick() + 76
    frame #30: 0x00000001001d7983 factorio`GameActionHandler::update() + 771
    frame #31: 0x00000001002fdd8c factorio`MainLoop::gameUpdateStep() + 140
    frame #32: 0x00000001002fead0 factorio`MainLoop::updateLoop(ThreadBarrier*, boost::chrono::time_point<boost::chrono::system_clock, boost::chrono::duration<long long, boost::ratio<1l, 1000000000l> > >*) + 368
    frame #33: 0x00000001003f52f1 factorio`Thread::loop() + 273
    frame #34: 0x000000010083fa68 factorio`boost::(anonymous namespace)::thread_proxy(void*) + 136
    frame #35: 0x00007fff8b8aa2fc libsystem_pthread.dylib`_pthread_body + 131
    frame #36: 0x00007fff8b8aa279 libsystem_pthread.dylib`_pthread_start + 176
    frame #37: 0x00007fff8b8a84b1 libsystem_pthread.dylib`thread_start + 13

Re: [0.11.3] Game crashes on game.findentities with wrong ar

Posted: Fri Nov 28, 2014 10:56 am
by kovarex
And the crash was created with this command?

Code: Select all

/c game.findentities{area={{-1, -1}, {1, 1}}}
Edit: what is your system?

Re: [0.11.3] Game crashes on game.findentities with wrong ar

Posted: Fri Nov 28, 2014 1:29 pm
by Xecutor
kovarex wrote:And the crash was created with this command?

Code: Select all

/c game.findentities{area={{-1, -1}, {1, 1}}}
Edit: what is your system?
Yes, I copy/pasted this exact line into game's console.
Mac mini with Mac OS X 10.10.1

Re: [0.11.3] Game crashes on game.findentities with wrong ar

Posted: Thu Jan 29, 2015 6:07 pm
by kovarex
Well, in that case it is a black magic related, because this is even included in our automated tests and it passes on the yosemite as well.

I'm moving this to 0/1 magic.

Re: [0.11.3] Game crashes on game.findentities with wrong ar

Posted: Fri Jan 30, 2015 6:08 am
by Xecutor
I tested this again and now it's working as intended, i.e. reporting proper error.
I think I updated xcode not too long ago. Probably it was some kind of error in system libraries.