#20 Spawn removed while being processed for spawn condition

Cerrada
abierta hace 4 años por image · 2 comentarios
image comentado hace 4 años

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 mencionada esta incidencia en un commit hace 4 años
image comentado hace 4 años
Colaborador

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 comentado hace 4 años
Colaborador

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.
Inicie sesión para unirse a esta conversación.
Cargando...
Cancelar
Guardar
Aún no existe contenido.