Blizzard / s2client-api

StarCraft II Client - C++ library supported on Windows, Linux and Mac designed for building scripted bots and research using the SC2API.
MIT License
1.66k stars 282 forks source link

Access Violation in sc2_client.css ObservationImp::UpdateObservation() #289

Open LiliumAtratum opened 5 years ago

LiliumAtratum commented 5 years ago

I am writing a SC2 bot written in C++. The bot is tested using the sc2 coordinator in a standard way (copied code from tutorials), except that it runs in non-realtime and non-multithreaded way.

Sometimes, when the game updates, it sometimes crashes. In my test scenario it occurs sometimes when a hostile marine is killing probes mining gas. I don't know if there is a connection or it is just a coincidence.

Here is the stacktrace:

0xC0000005: Access violation writing location 0xFFFFFFFF00000000

std::_Container_base12::_Orphan_all() Line 256  C++ Non-user code. Symbols loaded.
std::_Vector_alloc<std::_Vec_base_types<sc2::SC2Type<enum sc2::BUFF_ID>,std::allocator<sc2::SC2Type<enum sc2::BUFF_ID> > > >::_Orphan_all() Line 580    C++ Non-user code. Symbols loaded.
std::vector<sc2::SC2Type<enum sc2::BUFF_ID>,std::allocator<sc2::SC2Type<enum sc2::BUFF_ID> > >::_Tidy() Line 2003   C++ Non-user code. Symbols loaded.
std::vector<sc2::SC2Type<enum sc2::BUFF_ID>,std::allocator<sc2::SC2Type<enum sc2::BUFF_ID> > >::~vector<sc2::SC2Type<enum sc2::BUFF_ID>,std::allocator<sc2::SC2Type<enum sc2::BUFF_ID> > >() Line 920   C++ Non-user code. Symbols loaded.
sc2::Unit::~Unit()  C++ Non-user code. Symbols loaded.
std::pair<unsigned __int64 const ,sc2::Unit>::~pair<unsigned __int64 const ,sc2::Unit>()    C++ Non-user code. Symbols loaded.
std::pair<unsigned __int64 const ,sc2::Unit>::`scalar deleting destructor'(unsigned int)    C++ Non-user code. Symbols loaded.
std::_Default_allocator_traits<std::allocator<std::_List_node<std::pair<unsigned __int64 const ,sc2::Unit>,void * __ptr64> > >::destroy<std::pair<unsigned __int64 const ,sc2::Unit> >(std::allocator<std::_List_node<std::pair<unsigned __int64 const ,sc2::Unit>,void *> > & __formal={...}, std::pair<unsigned __int64 const ,sc2::Unit> * const _Ptr=0x000001818c6defe0) Line 952   C++ Non-user code. Symbols loaded.
std::_List_buy<std::pair<unsigned __int64 const ,sc2::Unit>,std::allocator<std::pair<unsigned __int64 const ,sc2::Unit> > >::_Freenode(std::_List_node<std::pair<unsigned __int64 const ,sc2::Unit>,void *> * _Pnode=0x000001818c6defd0) Line 777   C++ Non-user code. Symbols loaded.
std::list<std::pair<unsigned __int64 const ,sc2::Unit>,std::allocator<std::pair<unsigned __int64 const ,sc2::Unit> > >::clear() Line 1451   C++ Non-user code. Symbols loaded.
std::_Hash<std::_Umap_traits<unsigned __int64,sc2::Unit,std::_Uhash_compare<unsigned __int64,std::hash<unsigned __int64>,std::equal_to<unsigned __int64> >,std::allocator<std::pair<unsigned __int64 const ,sc2::Unit> >,0> >::clear() Line 633 C++ Non-user code. Symbols loaded.
sc2::ObservationImp::UpdateObservation() Line 589   C++ Symbols loaded.
sc2::ControlImp::GetObservation() Line 1977 C++ Symbols loaded.
sc2::ControlImp::WaitStep() Line 1765   C++ Symbols loaded.
sc2::CoordinatorImp::StepAgents::__l2::<lambda>(sc2::Agent * a=0x0000002ae62ff030) Line 303 C++ Symbols loaded.
    [External Code]     Annotated Frame
invoke_thread_procedure(unsigned int(*)(void *) procedure=0x00007ff702eb072b, void * const context=0x0000002ae62feb80) Line 92  C++ Symbols loaded.
thread_start<unsigned int (__cdecl*)(void * __ptr64)>(void * const parameter=0x000001818c9b5b90) Line 115   C++ Symbols loaded.
    [External Code]     Annotated Frame

The game state when the crash occurs. The crashed controller causes the game to freeze.

bug