Jump to content

[Crash] [8661] Crash while a map is loading: Map Container


Guest ckegg

Recommended Posts

Mangos Version: 8661

Custom Patches: AHbot

SD2 Version: 1476

Database Name and Version : YTDB 513

Vary crash time from 1 minute to 1 hour. Higher chance to crash server when a map is loading.

In debug mode, gdb ended up with this all the time (8 runs):

mangos-worldd: ../../../src/game/../framework/GameSystem/TypeContainer.h:78: static bool TypeUnorderedMapContainer<OBJECT_TYPES, KEY_TYPE>::insert(ContainerUnorderedMap<SPECIFIC_TYPE, KEY_TYPE>&, KEY_TYPE, SPECIFIC_TYPE*) [with SPECIFIC_TYPE = Creature, OBJECT_TYPES = TypeList<Creature, TypeList<Pet, TypeList<Vehicle, TypeList<GameObject, TypeList<DynamicObject, TypeNull> > > > >, KEY_TYPE = long unsigned int]: Assertion `i->second == obj && "Object with certain key already in but objects are different!"' failed.

Program received signal SIGABRT, Aborted.
[switching to Thread 0x7fae6e154950 (LWP 9587)]
0x00007fae767bdfb5 in raise () from /lib/libc.so.6

Occur very often when a player is entering the world, or when a player is teleporting (spell, portal) to a different map. Debug log can find these always before gdb halt:

VMAP loaded name:Northrend, id:571, x:24, y:38
VMAP loaded name:Eastern Kingdoms, id:0, x:34, y:33
VMAP loaded name:Kalimdor, id:1, x:45, y:35

Link to comment
Share on other sites

confirm. !! Related here

Using host libthread_db library "/lib/libthread_db.so.1".
Core was generated by `./bin/mangos-worldd -c etc/mangosd.conf'.
Program terminated with signal 6, Aborted.
#0  0xb7642c66 in raise () from /lib/libc.so.6
#0  0xb7642c66 in raise () from /lib/libc.so.6
No symbol table info available.
#1  0xb7644571 in abort () from /lib/libc.so.6
No symbol table info available.
#2  0xb763be60 in __assert_fail () from /lib/libc.so.6
No symbol table info available.
#3  0x081721e9 in Creature::AddToWorld (this=0x18565f50) at ../../../src/game/../framework/GameSystem/TypeContainer.h:78
No locals.
#4  0x082559ba in Map::Add<Creature> (this=0xaf75b880, obj=0x18565f50) at ../../../src/game/Map.cpp:482
       p = {x_coord = 328, y_coord = 289}
       cell = {data = {Part = {grid_x = 41, grid_y = 36, cell_x = 0, cell_y = 1, nocreate = 0, reserved = 0}, All = 264489}}
       grid = <value optimized out>
       __PRETTY_FUNCTION__ = "void Map::Add(T*) [with T = Creature]"
#5  0x08331691 in PoolGroup<Creature>::Spawn1Object (this=0xade2c678, guid=86403) at ../../../src/game/PoolHandler.cpp:256
       pCreature = (class Creature *) 0x18565f50
#6  0x0833512c in PoolGroup<Creature>::SpawnObject (this=0xade2c678, limit=1, cache=true) at ../../../src/game/PoolHandler.cpp:192
       roll = 86403
#7  0x081793e8 in Creature::Update (this=0xe2db248, diff=174) at ../../../src/game/Creature.cpp:387
       poolid = 6
#8  0x0824b7c6 in VisitorHelper<MaNGOS::ObjectUpdater, Creature> (v=@0xa4fa1268, c=@0xe2c07f4) at ../../../src/game/GridNotifiersImpl.h:47
No locals.
#9  0x0824d665 in VisitorHelper<MaNGOS::ObjectUpdater, Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > (v=@0xa4fa1268, c=@0xe2c07f4)
   at ../../../src/game/../framework/GameSystem/TypeContainerVisitor.h:70
No locals.
#10 0x082473c1 in Map::Update (this=0xaf75b880, t_diff=@0xa4fa12a8) at ../../../src/game/../framework/GameSystem/TypeContainerVisitor.h:105
       cell = {data = {Part = {grid_x = 41, grid_y = 36, cell_x = 0, cell_y = 1, nocreate = 1, reserved = 16}, All = 553912617}}
       cell_id = <value optimized out>
       y = 289
       x = 328
       plr = <value optimized out>
       area = {right_offset = 2, left_offset = 1, upper_offset = 1, lower_offset = 1}
       updater = {i_timeDiff = 174}
       __PRETTY_FUNCTION__ = "virtual void Map::Update(const uint32&)"
#11 0x082584a1 in MapManager::Update (this=0xaf75b508, diff=87) at ../../../src/game/MapManager.cpp:268
       iter = {_M_cur = 0xaf75a388, _M_ht = 0xaf75b550}
#12 0x083ee1ee in World::Update (this=0xb6d0da80, diff=87) at ../../../src/game/World.cpp:1652
       next = {_M_cur = 0x0, _M_ht = 0x0}
       autobroadcaston = 1
#13 0x0812a1ce in WorldRunnable::run (this=0x8636030) at ../../../src/mangosd/WorldRunnable.cpp:64
       diff = 87
       realCurrTime = 1764153697
       realPrevTime = <value optimized out>
       prevSleepTime = 71
#14 0x084b5732 in ACE_Based::Thread::ThreadTask (param=0x8636030) at ../../../src/shared/Threading.cpp:183
No locals.
#15 0xb7e861a7 in ACE_OS_Thread_Adapter::invoke () from /home/wow/mangos_git_compiled/lib/libACE-5.6.6.so
No symbol table info available.
#16 0xb7e363df in ace_thread_adapter () from /home/wow/mangos_git_compiled/lib/libACE-5.6.6.so
No symbol table info available.
#17 0xb779a369 in start_thread () from /lib/libpthread.so.0
No symbol table info available.
#18 0xb76eccfe in clone () from /lib/libc.so.6
No symbol table info available.

Link to comment
Share on other sites

This patches fixed crash.

diff --git a/src/game/PoolHandler.h b/src/game/PoolHandler.h
index 652d8e2..17528f0 100644
--- a/src/game/PoolHandler.h
+++ b/src/game/PoolHandler.h
@@ -46,7 +46,7 @@ class PoolGroup
        bool isEmpty() { return ExplicitlyChanced.empty() && EqualChanced.empty(); }
        void AddEntry(PoolObject& poolitem, uint32 maxentries);
        bool CheckPool(void);
-        uint32 RollOne(void);
+        int32 RollOne(void);
        bool IsSpawnedObject(uint32 guid);
        void DespawnObject(uint32 guid=0);
        void Despawn1Object(uint32 guid);

diff --git a/src/game/PoolHandler.cpp b/src/game/PoolHandler.cpp
index e038add..e3f5045 100644
--- a/src/game/PoolHandler.cpp
+++ b/src/game/PoolHandler.cpp
@@ -52,7 +52,7 @@ bool PoolGroup<T>::CheckPool(void)
    if (EqualChanced.size() == 0)
    {
        float chance = 0;
-        for (uint32 i=0; i<ExplicitlyChanced.size(); ++i)
+        for (uint32 i=0; i < ExplicitlyChanced.size(); ++i)
            chance += ExplicitlyChanced[i].chance;
        if (chance != 100 && chance != 0)
            return false;
@@ -67,7 +67,7 @@ bool PoolGroup<T>::IsSpawnedObject(uint32 guid)
    for (uint32 i=0; i<ExplicitlyChanced.size(); ++i)
        if (ExplicitlyChanced[i].guid == guid)
            return ExplicitlyChanced[i].spawned;
-    for (uint32 i=0; i<EqualChanced.size(); ++i)
+    for (uint32 i=0; i < EqualChanced.size(); ++i)
        if (EqualChanced[i].guid == guid)
            return EqualChanced[i].spawned;
    return false;
@@ -76,7 +76,7 @@ bool PoolGroup<T>::IsSpawnedObject(uint32 guid)
// Method that return a guid of a rolled creature or gameobject
// Note: Copy from loot system because it's very similar and only few things change
template <class T>
-uint32 PoolGroup<T>::RollOne(void)
+int32 PoolGroup<T>::RollOne(void)
{
    if (!ExplicitlyChanced.empty())                         // First explicitly chanced entries are checked
    {
@@ -86,13 +86,13 @@ uint32 PoolGroup<T>::RollOne(void)
        {
            roll -= ExplicitlyChanced[i].chance;
            if (roll < 0)
-                return ExplicitlyChanced[i].guid;
+                return i;
        }
    }
    if (!EqualChanced.empty())
        return EqualChanced[irand(0, EqualChanced.size()-1)].guid;

-    return 0;                                               // None found
+    return -1;                                               // None found
}

// Main method to despawn a creature or gameobject in a pool
@@ -119,6 +119,21 @@ void PoolGroup<T>::DespawnObject(uint32 guid)
            }
        }
    }
+    for (size_t i = 0; i < ExplicitlyChanced.size(); ++i)
+    {
+        if (ExplicitlyChanced[i].spawned)
+           {
+               if (!guid || ExplicitlyChanced[i].guid == guid)
+               {
+                   if (guid)
+                           m_LastDespawnedNode = ExplicitlyChanced[i].guid;
+                       else
+                           Despawn1Object(ExplicitlyChanced[i].guid);
+
+                       ExplicitlyChanced[i].spawned = false;
+               }
+           }
+    }
}

// Method that is actualy doing the removal job on one creature
@@ -182,17 +197,22 @@ void PoolGroup<Pool>::RemoveOneRelation(uint16 child_pool_id)
template <class T>
void PoolGroup<T>::SpawnObject(uint32 limit, bool cache)
{
-    if (limit == 1)                                         // This is the only case where explicit chance is used
+    if (limit == 1 && ExplicitlyChanced.size())                                         // This is the only case where explicit chance is used
    {
-        uint32 roll = RollOne();
-        if (!cache || (cache && m_LastDespawnedNode != roll))
+        int32 roll = RollOne(); // it`s index
+        //sLog.outString(">> RollOne is %i",roll);
+        if (roll == -1) // wtf? database?
+            return;
+
+        if (!cache || (cache && m_LastDespawnedNode != ExplicitlyChanced[roll].guid))
        {
            if (cache)
                Despawn1Object(m_LastDespawnedNode);
-            Spawn1Object(roll);
+            ExplicitlyChanced[roll].spawned = Spawn1Object(ExplicitlyChanced[roll].guid);
        }
        else
-            ReSpawn1Object(roll);
+            ExplicitlyChanced[roll].spawned = ReSpawn1Object(ExplicitlyChanced[roll].guid);
+
        m_LastDespawnedNode = 0;
    }
    else if (limit < EqualChanced.size() && m_SpawnedPoolAmount < limit)
@@ -439,6 +459,11 @@ void PoolHandler::LoadFromDB()
                continue;
            }
            PoolTemplateData *pPoolTemplate = &mPoolTemplate[pool_id];
+            if (chance && pPoolTemplate->MaxLimit > 1) // code doestn`t support this
+            {
+                sLog.outErrorDb("`pool_creature` can`t has explicit chance with MaxLimit > 1 in pool id (%i)", pool_id);
+                continue;
+            }
            ++count;

            PoolObject plObject = PoolObject(guid, chance);
@@ -508,7 +533,11 @@ void PoolHandler::LoadFromDB()
                continue;
            }
            PoolTemplateData *pPoolTemplate = &mPoolTemplate[pool_id];
-
+            if (chance && pPoolTemplate->MaxLimit > 1)
+            {
+                   sLog.outErrorDb("`pool_gameobject` can`t has explicit chance with MaxLimit > 1 in pool id (%i)",pool_id);
+                       continue;
+            }
            ++count;

            PoolObject plObject = PoolObject(guid, chance);

Link to comment
Share on other sites

Mangos: 8676

SD2: 1476

UDB: 383

Acid: 3.0

Debian 5.0.3

No custom content

As of revision 8676 this error is still present.

mangos-worldd: ../../../src/game/../framework/GameSystem/TypeContainer.h:78: static bool TypeUnorderedMapContainer::insert(ContainerUnorderedMap&, KEY_TYPE, SPECIFIC_TYPE*) [with SPECIFIC_TYPE = Creature, OBJECT_TYPES = TypeList > > > >, KEY_TYPE = long unsigned int]: Assertion `i->second == obj && "Object with certain key already in but objects are different!"' failed. 

Link to comment
Share on other sites

Need help with the server since it walks callendo frequently at present the emulador is handles and the version of wow is 3.2.2To

to continuacion leave the error that goes out expects help me to solve the problem and aque actually have not been able to

mangos-worldd../../../src/game/map.cpp:2384:virtual bool/instancemap::Add(player*):assertion ´false´failed

Link to comment
Share on other sites

Maybe this is related.

mangos>Player::addSpell: Non-existed in SpellStore spell #20554 request.
HandleMoveNotActiveMover: incorrect mover guid: mover is 0000000000000592 and should be 0000000000000592 instead of 1426
SPELL: wrong map (1 instead 530) target coordinates for spell ID 3567
WORLD: CMSG_ITEM_NAME_QUERY for item 48846 failed (item listed in Item.dbc but not exist in DB)
WORLD: CMSG_ITEM_NAME_QUERY for item 48847 failed (item listed in Item.dbc but not exist in DB)
WORLD: CMSG_ITEM_NAME_QUERY for item 48848 failed (item listed in Item.dbc but not exist in DB)
WORLD: CMSG_ITEM_NAME_QUERY for item 48849 failed (item listed in Item.dbc but not exist in DB)
WORLD: CMSG_ITEM_NAME_QUERY for item 48850 failed (item listed in Item.dbc but not exist in DB)
WORLD: CMSG_ITEM_NAME_QUERY for item 48829 failed (item listed in Item.dbc but not exist in DB)
WORLD: CMSG_ITEM_NAME_QUERY for item 48830 failed (item listed in Item.dbc but not exist in DB)
WORLD: CMSG_ITEM_NAME_QUERY for item 48831 failed (item listed in Item.dbc but not exist in DB)
WORLD: CMSG_ITEM_NAME_QUERY for item 48832 failed (item listed in Item.dbc but not exist in DB)
WORLD: CMSG_ITEM_NAME_QUERY for item 48833 failed (item listed in Item.dbc but not exist in DB)
Delete GameObject (GUID: 200002 Entry: 31442 SpellId 818 LinkedGO 0) that lost references to owner (GUID 2926 Type 'player') GO list. Crash possible later.
Delete GameObject (GUID: 200001 Entry: 29784 SpellId 818 LinkedGO 31442) that lost references to owner (GUID 2926 Type 'player') GO list. Crash possible later.

The 2 lines at the end say player lost reference to a go and crash may be later. What can be done in this case.

Link to comment
Share on other sites

  • 2 months later...

Crash still present in 9110.

mangos-worldd: ../../../src/game/../framework/GameSystem/TypeContainer.h:78: static bool TypeUnorderedMapContainer<OBJECT_TYPES, KEY_TYPE>::insert(ContainerUn
orderedMap<SPECIFIC_TYPE, KEY_TYPE>&, KEY_TYPE, SPECIFIC_TYPE*) [with SPECIFIC_TYPE = GameObject, OBJECT_TYPES = TypeList<Creature, TypeList<Pet, TypeList<Veh
icle, TypeList<GameObject, TypeList<DynamicObject, TypeNull> > > > >, KEY_TYPE = long unsigned int]: Assertion `i->second == obj && "Object with certain key a
lready in but objects are different!"' failed.

Program received signal SIGABRT, Aborted.
[switching to Thread 0x7fa552547950 (LWP 8911)]
0x00007fa55a1c5ea5 in raise () from /lib64/libc.so.6
(gdb) info program
       Using the running image of child Thread 0x7fa552547950 (LWP 8911).
Program stopped at 0x7fa55a1c5ea5.
It stopped with signal SIGABRT, Aborted.

(gdb) bt
#0  0x00007fa55a1c5ea5 in raise () from /lib64/libc.so.6
#1  0x00007fa55a1c7ab3 in abort () from /lib64/libc.so.6
#2  0x00007fa55a1bee99 in __assert_fail () from /lib64/libc.so.6
#3  0x0000000000559c4b in GameObject::AddToWorld (this=0x23dbe830) at ../../../src/game/../framework/GameSystem/TypeContainer.h:78
warning: (Internal error: pc 0x5de23c in read in psymtab, but not in symtab.)

#4  0x00000000005de23d in Map::Add<GameObject> (this=warning: (Internal error: pc 0x5ddfb0 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x5de23c in read in psymtab, but not in symtab.)

0x7fa5429cda10, obj=0x23dbe830) at ../../../src/game/Map.cpp:483
#5  0x000000000069c428 in PoolGroup<GameObject>::Spawn1Object (this=<value optimized out>, guid=26264) at ../../../src/game/PoolManager.cpp:294
warning: (Internal error: pc 0x69eba0 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x69eba0 in read in psymtab, but not in symtab.)

#6  0x000000000069eba1 in PoolGroup<GameObject>::SpawnObject (this=warning: (Internal error: pc 0x69eb20 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x69eba0 in read in psymtab, but not in symtab.)

0x7fa54a738db0, limit=<value optimized out>, triggerFrom=26535)
   at ../../../src/game/PoolManager.cpp:229
#7  0x0000000000558267 in GameObject::Update (this=0x7fa53d0f43f0) at ../../../src/game/GameObject.cpp:263
#8  0x000000000079df06 in MaNGOS::ObjectUpdater::Visit<GameObject> (this=0x7fa552546fa0, m=<value optimized out>) at ../../../src/game/GridNotifiers.cpp:220
#9  0x00000000005d2b02 in Map::Update (this=0x7fa5429cda10, t_diff=@0x7fa552546ffc) at ../../../src/game/../framework/GameSystem/TypeContainerVisitor.h:64
#10 0x00000000005dffc7 in MapManager::Update (this=0x7fa54afdc210, diff=<value optimized out>) at ../../../src/game/MapManager.cpp:265
#11 0x00000000007504c4 in World::Update (this=0x7fa554006db0, diff=16) at ../../../src/game/World.cpp:1677
#12 0x00000000004d7330 in WorldRunnable::run (this=<value optimized out>) at ../../../src/mangosd/WorldRunnable.cpp:60
#13 0x00000000007ffc4c in ACE_Based::Thread::ThreadTask (param=0x2274) at ../../../src/shared/Threading.cpp:183
#14 0x00007fa55a9a63a0 in start_thread () from /lib64/libpthread.so.0
#15 0x00007fa55a277bdd in clone () from /lib64/libc.so.6

(gdb) bt full
#0  0x00007fa55a1c5ea5 in raise () from /lib64/libc.so.6
No symbol table info available.
#1  0x00007fa55a1c7ab3 in abort () from /lib64/libc.so.6
No symbol table info available.
#2  0x00007fa55a1bee99 in __assert_fail () from /lib64/libc.so.6
No symbol table info available.
#3  0x0000000000559c4b in GameObject::AddToWorld (this=0x23dbe830) at ../../../src/game/../framework/GameSystem/TypeContainer.h:78
No locals.
#4  0x00000000005de23d in Map::Add<GameObject> (this=0x7fa5429cda10, obj=0x23dbe830) at ../../../src/game/Map.cpp:483
       p = {x_coord = 61, y_coord = 263}
       cell = {data = {Part = {grid_x = 7, grid_y = 32, cell_x = 5, cell_y = 7, nocreate = 0, reserved = 0}, All = 1857543}}
       grid = (NGridType *) 0x7fa53cb24b10
       __PRETTY_FUNCTION__ = "void Map::Add(T*) [with T = GameObject]"
#5  0x000000000069c428 in PoolGroup<GameObject>::Spawn1Object (this=<value optimized out>, guid=26264) at ../../../src/game/PoolManager.cpp:294
       pGameobject = (class GameObject *) 0x23dbe830
       map = (class Map *) 0x7fa5429cda10
       data = <value optimized out>
#6  0x000000000069eba1 in PoolGroup<GameObject>::SpawnObject (this=0x7fa54a738db0, limit=<value optimized out>, triggerFrom=26535)
   at ../../../src/game/PoolManager.cpp:229
       index = 1515186640
       store = (std::vector<PoolObject, std::allocator<PoolObject> > *) 0xffffffffffffffff
       i = 0
       lastDespawned = 0
       count = 1
#7  0x0000000000558267 in GameObject::Update (this=0x7fa53d0f43f0) at ../../../src/game/GameObject.cpp:263
       poolid = 8911
#8  0x000000000079df06 in MaNGOS::ObjectUpdater::Visit<GameObject> (this=0x7fa552546fa0, m=<value optimized out>) at ../../../src/game/GridNotifiers.cpp:220
No locals.
#9  0x00000000005d2b02 in Map::Update (this=0x7fa5429cda10, t_diff=@0x7fa552546ffc) at ../../../src/game/../framework/GameSystem/TypeContainerVisitor.h:64
       cell = {data = {Part = {grid_x = 7, grid_y = 32, cell_x = 5, cell_y = 7, nocreate = 1, reserved = 16}, All = 555505671}}
       y = 263
       x = 61
       plr = <value optimized out>
       area = {right_offset = 1, left_offset = 2, upper_offset = 2, lower_offset = 1}
       updater = {i_timeDiff = 109}
       grid_object_update = {i_visitor = @0x7fa552546fa0}
       world_object_update = {i_visitor = @0x7fa552546fa0}
       __PRETTY_FUNCTION__ = "virtual void Map::Update(const uint32&)"
#10 0x00000000005dffc7 in MapManager::Update (this=0x7fa54afdc210, diff=<value optimized out>) at ../../../src/game/MapManager.cpp:265
No locals.
#11 0x00000000007504c4 in World::Update (this=0x7fa554006db0, diff=16) at ../../../src/game/World.cpp:1677
---Type <return> to continue, or q <return> to quit---
       autobroadcaston = 0
#12 0x00000000004d7330 in WorldRunnable::run (this=<value optimized out>) at ../../../src/mangosd/WorldRunnable.cpp:60
       diff = 16
       realCurrTime = 1014239252
       realPrevTime = <value optimized out>
       prevSleepTime = 0
#13 0x00000000007ffc4c in ACE_Based::Thread::ThreadTask (param=0x2274) at ../../../src/shared/Threading.cpp:183
       _task = (class ACE_Based::Runnable *) 0x7fa5410733b0
#14 0x00007fa55a9a63a0 in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#15 0x00007fa55a277bdd in clone () from /lib64/libc.so.6
No symbol table info available.

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