#20 Spawn removed while being processed for spawn condition

Закрыто
4 лет назад открыта image · комментариев: 2
image прокомментировал 4 лет назад

A spawn being removed while the spawn condition for day/night is being triggered causes a crash on SpawnConditionID().. because the itr->second is null

void ZoneServer::ProcessSpawnConditional(int8 condition) {
MSpawnLocationList.readlock(__FUNCTION__, __LINE__);
MSpawnList.readlock(__FUNCTION__, __LINE__);
map<int32, Spawn*>::iterator itr;
for (itr = spawn_list.begin(); itr != spawn_list.end(); itr++) {
        SpawnLocation* loc = spawn_location_list[itr->second->GetSpawnLocationID()];()];
    // we crash here ^^^ on itr->second = NULL

Our setting of NULL to a spawn ID on spawn removal is not ideal, we should erase from the spawn list...

A spawn being removed while the spawn condition for day/night is being triggered causes a crash on SpawnConditionID().. because the itr->second is null void ZoneServer::ProcessSpawnConditional(int8 condition) { MSpawnLocationList.readlock(__FUNCTION__, __LINE__); MSpawnList.readlock(__FUNCTION__, __LINE__); map<int32, Spawn*>::iterator itr; for (itr = spawn_list.begin(); itr != spawn_list.end(); itr++) { SpawnLocation* loc = spawn_location_list[itr->second->GetSpawnLocationID()];()]; // we crash here ^^^ on itr->second = NULL Our setting of NULL to a spawn ID on spawn removal is not ideal, we should erase from the spawn list...
image упомянул эту задачу в коммите 4 лет назад
image прокомментировал 4 лет назад
Соавтор

trace I had received on this event:

 EQ2World__Debug_x64.exe!Spawn::GetSpawnLocationID() Line 1112    C++
 EQ2WorldDebug_x64.exe!ZoneServer::ProcessSpawnConditional(unsigned char condition) Line 6983    C++
 EQ2WorldDebug_x64.exe!ZoneServer::Process() Line 1420    C++
 EQ2WorldDebug_x64.exe!ZoneLoop(void * tmp) Line 6146    C++
 EQ2WorldDebug_x64.exe!thread_start<void (__cdecl*)(void *),0>(void * const parameter) Line 102    C++
trace I had received on this event: EQ2World__Debug_x64.exe!Spawn::GetSpawnLocationID() Line 1112 C++ EQ2WorldDebug_x64.exe!ZoneServer::ProcessSpawnConditional(unsigned char condition) Line 6983 C++ EQ2WorldDebug_x64.exe!ZoneServer::Process() Line 1420 C++ EQ2WorldDebug_x64.exe!ZoneLoop(void * tmp) Line 6146 C++ EQ2WorldDebug_x64.exe!thread_start<void (__cdecl*)(void *),0>(void * const parameter) Line 102 C++
image прокомментировал 4 лет назад
Соавтор

As another note the process thats supposed to clean up these dead spawn pointers is

pending_spawn_list_remove inside bool ZoneServer::SpawnProcess() ... however with that delay in place between the removal of the null entry and this ProcessSpawnConditional missing a NULL check on itr->second we ran into the crash.

As another note the process thats supposed to clean up these dead spawn pointers is pending_spawn_list_remove inside bool ZoneServer::SpawnProcess() ... however with that delay in place between the removal of the null entry and this ProcessSpawnConditional missing a NULL check on itr->second we ran into the crash.
Войдите, чтобы присоединиться к обсуждению.
Загрузка...
Отмена
Сохранить
Пока нет содержимого.