Jump to content

[9783] InstanceMap::Add() Crash


Guest polonawa

Recommended Posts

Hi ,

I just noticed a special crash appearing just after another one if one group is in raid during the first crash.

I got this backtrace

#4  0x084fe6c9 in InstanceMap::Add (this=0x969736f0, player=0xa321a188) at ../../../src/game/Map.cpp:2437
#5  0x08777c5c in WorldSession::HandlePlayerLogin (this=0x96b900e0, holder=0xa36f60b8) at ../../../src/game/CharacterHandler.cpp:704
#6  0x0877bc40 in CharacterHandler::HandlePlayerLoginCallback (this=0x8920d54, holder=0xa36f60b8) at ../../../src/game/CharacterHandler.cpp:133
#7  0x0877afbe in MaNGOS::_Callback<CharacterHandler, QueryResult*, SqlQueryHolder*, void, void>::_Execute (this=0x98d1d154)
   at ../../../src/game/../framework/Utilities/Callback.h:92
#8  0x0877afd8 in MaNGOS::_IQueryCallback<MaNGOS::_Callback<CharacterHandler, QueryResult*, SqlQueryHolder*, void, void> >::Execute (this=0x98d1d150)
   at ../../../src/game/../framework/Utilities/Callback.h:405
#9  0x087a0165 in SqlResultQueue::Update (this=0xcc4de90) at ../../../../src/shared/Database/SqlOperations.cpp:77
#10 0x086ebdcd in World::UpdateResultQueue (this=0xb6a229e8) at ../../../src/game/World.cpp:1965
#11 0x086f3436 in World::Update (this=0xb6a229e8, diff=26) at ../../../src/game/World.cpp:1464
#12 0x0839b64f in WorldRunnable::run (this=0xb2c8faf0) at ../../../src/mangosd/WorldRunnable.cpp:60

I found the related piece of code in Map.cpp

bool InstanceMap::CanEnter(Player *player)
{
   if(player->GetMapRef().getTarget() == this)
   {
       sLog.outError("InstanceMap::CanEnter - player %s(%u) already in map %d,%d,%d!", player->GetName(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode());
       ASSERT(false);
       return false;
   }

...

Why is there an assert here ? Isnt'it possible to replace it by a player teleport to his homebind ?

Maybe am I totally blind , but I don't understand this Assert, really.

Thanks for reading.

Link to comment
Share on other sites

it is called when player try to login in instance to whom he is not bound. so obvously it should not happen (you can call it exploit). than server informs you in significant way (closing application) that something is wrong. afaik it can be done when player kill bos to bind himself => than leave party => get party with 2nd player otside instance =? > logout => 2nd player reset difficulty => player inside instance login to new created instance with old id so app encounters mismatch that is checked by ASSERT.

Link to comment
Share on other sites

Yes, I understand the check but I just think that the server decision is a bit strict in this case, that's all. killing the process is a bit strong isn't it ? Thats why I was asking if it could be better to replace the assert by something else, like a player kick or a player teleport...

Thanks for all those explanations and sry for my bad english :)

Link to comment
Share on other sites

hack-fix, but it should help with problem

diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index acb66ec..7f7f9cc 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -2410,7 +2410,7 @@ bool InstanceMap::Add(Player *player)
                                sLog.outError("GroupBind save players: %d, group count: %d", groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount());
                            else
                                sLog.outError("GroupBind save NULL");
-                            ASSERT(false);
+                            player->RepopAtGraveyard();
                        }
                        // if the group/leader is permanently bound to the instance
                        // players also become permanently bound when they enter

And another

diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index fc7dab7..1766310 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -2214,7 +2214,7 @@ bool InstanceMap::Add(Player *player)
                if(playerBind->save != mapSave)
                {
                    sLog.outError("InstanceMap::Add: player %s(%d) is permanently bound to instance %d,%d,%d,%d,%d,%d but he is being put in instance %d,%d,%d,%d,%d,%d", player->GetName(), player->GetGUIDLow(), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset());
-                    ASSERT(false);
+                    player->RepopAtGraveyard();
                }
            }
            else

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use