alexandre-roulin/nibbler

Exit during game runtime with IA

Closed this issue · 2 comments

When exiting game with red cross or ESC with somes IA

1 S
1 C
1 E
1 R
1 A
1 A
1 X
Then exit

crash report

#0 0x10bc5ae50 in KINU::World::getEntitiesManager() const memory:2580
#1 0x10bba2c14 in Bobby::define_priority(int, int) Bobby.cpp:52
#2 0x10bba4786 in Bobby::findDirection(KStar::Vec2, KStar::Vec2) Bobby.cpp:98
#3 0x10bba5419 in Bobby::calculateDirection() Bobby.cpp:161
#4 0x10bc707ee in boost::asio::detail::completion_handler<GameManager::loopWorldWork()::$_0>::do_complete(void*, boost::asio::detail::scheduler_operation*, boost::system::error_code const&, unsigned long) GameManager.cpp:129
#5 0x10bbc672d in boost::asio::detail::scheduler::do_run_one(boost::asio::detail::conditionally_enabled_mutex::scoped_lock&, boost::asio::detail::scheduler_thread_info&, boost::system::error_code const&) scheduler_operation.hpp:40
#6 0x10bbc54bd in boost::asio::detail::scheduler::run(boost::system::error_code&) scheduler.ipp:154
#7 0x10bbbcc6e in IOManager::IORunner() io_context.ipp:62
#8 0x10c01126b in boost::(anonymous namespace)::thread_proxy(void*) (libboost_thread-mt.dylib:x86_64+0x326b)
#9 0x7fffb7b2693a in _pthread_body (libsystem_pthread.dylib:x86_64+0x393a)
#10 0x7fffb7b26886 in _pthread_start (libsystem_pthread.dylib:x86_64+0x3886)
#11 0x7fffb7b2608c in thread_start (libsystem_pthread.dylib:x86_64+0x308c)

==67935==Register values:
rax = 0x0000000000000006  rbx = 0x000070000860f280  rcx = 0x0000100000000006  rdx = 0x0000000000000000
rdi = 0x0000000000000030  rsi = 0x0000000000000000  rbp = 0x000070000860f0f0  rsp = 0x000070000860f0f0
 r8 = 0x0000100000000000   r9 = 0x000000010be5d2c8  r10 = 0x00001000217cba59  r11 = 0xffffffff00000000
r12 = 0x0000100000000000  r13 = 0x00001c220000fb21  r14 = 0x0000000000000000  r15 = 0x000061100007d908
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV memory:2580 in KINU::World::getEntitiesManager() const
Thread T9 created by T0 here:
    #0 0x10c20b7a6 in wrap_pthread_create (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x4d7a6)
    #1 0x10c01115f in boost::thread::start_thread_noexcept() (libboost_thread-mt.dylib:x86_64+0x315f)
    #2 0x10bbbbeb7 in boost::thread* boost::thread_group::create_thread<boost::_bi::bind_t<void, boost::_mfi::mf0<void, IOManager>, boost::_bi::list1<boost::_bi::value<IOManager*> > > >(boost::_bi::bind_t<void, boost::_mfi::mf0<void, IOManager>, boost::_bi::list1<boost::_bi::value<IOManager*> > >) thread.hpp:179
    #3 0x10bbbb2de in IOManager::IOManager(unsigned long) IOManager.cpp:9
    #4 0x10bb77165 in Univers::Univers() memory:3006
    #5 0x10bb1ab30 in main main.cpp:51
    #6 0x7fffb790d234 in start (libdyld.dylib:x86_64+0x5234)

==67935==ABORTING

log.out

[ 19:19:47 ] (l. 97) IOTCP.cpp            -> void KNW::IOTCP::checkError(const boost::system::error_code &) 0
[ 19:19:47 ] (l.132) Bobby.cpp            -> void Bobby::calculateDirection()
[ 19:19:47 ] (l. 66) SnakeServer.cpp      -> void SnakeServer::callbackSnake(Snake &) id 0 score 22313 isUpdate 0
[ 19:19:47 ] (l.147) Bobby.cpp            -> FoodCondition[1][0]
[ 19:19:47 ] (l. 97) IOTCP.cpp            -> void KNW::IOTCP::checkError(const boost::system::error_code &) 0
[ 19:19:47 ] (l. 97) IOTCP.cpp            -> void KNW::IOTCP::checkError(const boost::system::error_code &) 0
[ 19:19:47 ] (l. 97) IOTCP.cpp            -> void KNW::IOTCP::checkError(const boost::system::error_code &) 0
[ 19:19:47 ] (l. 97) IOTCP.cpp            -> void KNW::IOTCP::checkError(const boost::system::error_code &) 0
[ 19:19:47 ] (l. 97) IOTCP.cpp            -> void KNW::IOTCP::checkError(const boost::system::error_code &) 0
[ 19:19:47 ] (l. 97) IOTCP.cpp            -> void KNW::IOTCP::checkError(const boost::system::error_code &) 0
[ 19:19:47 ] (l. 97) IOTCP.cpp            -> void KNW::IOTCP::checkError(const boost::system::error_code &) 0
[ 19:19:47 ] (l. 97) IOTCP.cpp            -> void KNW::IOTCP::checkError(const boost::system::error_code &) 0
[ 19:19:47 ] (l.252) Bobby.cpp            -> FoodSize(7)
[ 19:19:47 ] (l.149) GameManager.cpp      -> void GameManager::loopUI() finish
[ 19:19:48 ] (l.157) Bobby.cpp            -> FOOD::Pathfinding[0] path.size()[121]
[ 19:19:48 ] (l.160) Bobby.cpp            -> FOOD::Pathfinding[0] path.size()[121]

Fix thread again !

Thread is nice