#558 MHatedBy mutex needs rework

Closed
opened 1 month ago by image · 0 comments
image commented 1 month ago

its causing deadlocks

Thread 13 (Thread 0x7fffed6a1700 (LWP 21032)):
#0  __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:103
#1  0x00007ffff71b7714 in __GI___pthread_mutex_lock (mutex=0x62a00004fa98) at ../nptl/pthread_mutex_lock.c:80
#2  0x0000555555caf6bf in __gthread_mutex_lock (__mutex=0x62a00004fa98) at /usr/include/x86_64-linux-gnu/c++/8/bits/gthr-default.h:748
#3  0x0000555555caf710 in std::mutex::lock (this=0x62a00004fa98) at /usr/include/c++/8/bits/std_mutex.h:103
#4  0x0000555555e43ae2 in Brain::AddHate (this=0x616000007e80, entity=0x62a00004e200, hate=7) at ../WorldServer/NPC_AI.cpp:246
#5  0x0000555555eabada in Entity::AddHate (this=0x628000954100, attacker=0x62a00004e200, hate=7) at ../WorldServer/Combat.cpp:1243
#6  0x0000555555eab1d2 in Entity::DamageSpawn (this=0x62a00004e200, victim=0x628000954100, type=192 '\300', damage_type=0 '\000', low_damage=5, high_damage=10, spell_name=0x0, crit_mod=0 '\000', is_tick=false, no_calcs=false, ignore_attacker=false, take_power=false, spell=0x0) at ../WorldServer/Combat.cpp:1081
#7  0x0000555555ea7dca in Entity::MeleeAttack (this=0x62a00004e200, victim=0x628000954100, distance=3.89176035, primary=true, multi_attack=false) at ../WorldServer/Combat.cpp:244
#8  0x0000555555ead06a in Player::ProcessCombat (this=0x62a00004e200) at ../WorldServer/Combat.cpp:1538
#9  0x0000555555cff20b in ZoneServer::CombatProcess (this=0x628000004100, spawn=0x62a00004e200) at ../WorldServer/zoneserver.cpp:1274
#10 0x0000555555d021de in ZoneServer::SpawnProcess (this=0x628000004100) at ../WorldServer/zoneserver.cpp:1889
#11 0x0000555555d1fa86 in SpawnLoop (tmp=0x628000004100) at ../WorldServer/zoneserver.cpp:7606
#12 0x00007ffff71b4fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#13 0x00007ffff501406f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95


Thread 12 (Thread 0x7fffedea2700 (LWP 21031)):
#0  __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:103
#1  0x00007ffff71b7714 in __GI___pthread_mutex_lock (mutex=0x62a00004fa98) at ../nptl/pthread_mutex_lock.c:80
#2  0x0000555555caf6bf in __gthread_mutex_lock (__mutex=0x62a00004fa98) at /usr/include/x86_64-linux-gnu/c++/8/bits/gthr-default.h:748
#3  0x0000555555caf710 in std::mutex::lock (this=0x62a00004fa98) at /usr/include/c++/8/bits/std_mutex.h:103
#4  0x0000555555e43ae2 in Brain::AddHate (this=0x61600010e980, entity=0x62a00004e200, hate=0) at ../WorldServer/NPC_AI.cpp:246
#5  0x0000555556080638 in Spawn::CheckEncounterState (this=0x62a000000200, victim=0x6280008e0100, test_auto_lock=false) at ../WorldServer/Spawn.cpp:3754
#6  0x0000555555ea9a30 in Entity::SpellHeal (this=0x62a000000200, target=0x62a00004e200, distance=2.43889618, luaspell=0x61500092bb00, heal_type="heal", low_heal=55, high_heal=65, crit_mod=0 '\000', no_calcs=false, custom_spell_name="") at ../WorldServer/Combat.cpp:702
#7  0x0000555555efa27f in EQ2Emu_lua_SpellHeal (state=0x61b000adb088) at ../WorldServer/LuaFunctions.cpp:1394
#8  0x0000555556220d39 in luaD_precall ()
#9  0x0000555556232cca in luaV_execute ()
#10 0x0000555556221005 in ccall ()
#11 0x000055555622107a in luaD_callnoyield ()
#12 0x0000555556237da1 in f_call ()
#13 0x000055555621fdd7 in luaD_rawrunprotected ()
#14 0x00005555562217c0 in luaD_pcall ()
#15 0x0000555556237e71 in lua_pcallk ()
#16 0x0000555555e22bb8 in LuaInterface::CallSpellProcess (this=0x620000000080, spell=0x61500092bb00, num_parameters=5 '\005', customFunction="cast") at ../WorldServer/LuaInterface.cpp:625
#17 0x0000555555dedb8a in SpellProcess::ProcessSpell (this=0x61e000152480, spell=0x61500092bb00, first_cast=true, function=0x0, timer=0x0, all_targets=false) at ../WorldServer/SpellProcess.cpp:557
#18 0x0000555555df3759 in SpellProcess::CastProcessedSpell (this=0x61e000152480, spell=0x61500092bb00, passive=false, in_heroic_opp=false) at ../WorldServer/SpellProcess.cpp:1689
#19 0x0000555555deb490 in SpellProcess::Process (this=0x61e000152480) at ../WorldServer/SpellProcess.cpp:196
#20 0x0000555555d01630 in ZoneServer::Process (this=0x628000004100) at ../WorldServer/zoneserver.cpp:1729
#21 0x0000555555d1f91d in ZoneLoop (tmp=0x628000004100) at ../WorldServer/zoneserver.cpp:7582
#22 0x00007ffff71b4fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#23 0x00007ffff501406f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
its causing deadlocks ``` Thread 13 (Thread 0x7fffed6a1700 (LWP 21032)): #0 __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:103 #1 0x00007ffff71b7714 in __GI___pthread_mutex_lock (mutex=0x62a00004fa98) at ../nptl/pthread_mutex_lock.c:80 #2 0x0000555555caf6bf in __gthread_mutex_lock (__mutex=0x62a00004fa98) at /usr/include/x86_64-linux-gnu/c++/8/bits/gthr-default.h:748 #3 0x0000555555caf710 in std::mutex::lock (this=0x62a00004fa98) at /usr/include/c++/8/bits/std_mutex.h:103 #4 0x0000555555e43ae2 in Brain::AddHate (this=0x616000007e80, entity=0x62a00004e200, hate=7) at ../WorldServer/NPC_AI.cpp:246 #5 0x0000555555eabada in Entity::AddHate (this=0x628000954100, attacker=0x62a00004e200, hate=7) at ../WorldServer/Combat.cpp:1243 #6 0x0000555555eab1d2 in Entity::DamageSpawn (this=0x62a00004e200, victim=0x628000954100, type=192 '\300', damage_type=0 '\000', low_damage=5, high_damage=10, spell_name=0x0, crit_mod=0 '\000', is_tick=false, no_calcs=false, ignore_attacker=false, take_power=false, spell=0x0) at ../WorldServer/Combat.cpp:1081 #7 0x0000555555ea7dca in Entity::MeleeAttack (this=0x62a00004e200, victim=0x628000954100, distance=3.89176035, primary=true, multi_attack=false) at ../WorldServer/Combat.cpp:244 #8 0x0000555555ead06a in Player::ProcessCombat (this=0x62a00004e200) at ../WorldServer/Combat.cpp:1538 #9 0x0000555555cff20b in ZoneServer::CombatProcess (this=0x628000004100, spawn=0x62a00004e200) at ../WorldServer/zoneserver.cpp:1274 #10 0x0000555555d021de in ZoneServer::SpawnProcess (this=0x628000004100) at ../WorldServer/zoneserver.cpp:1889 #11 0x0000555555d1fa86 in SpawnLoop (tmp=0x628000004100) at ../WorldServer/zoneserver.cpp:7606 #12 0x00007ffff71b4fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486 #13 0x00007ffff501406f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 12 (Thread 0x7fffedea2700 (LWP 21031)): #0 __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:103 #1 0x00007ffff71b7714 in __GI___pthread_mutex_lock (mutex=0x62a00004fa98) at ../nptl/pthread_mutex_lock.c:80 #2 0x0000555555caf6bf in __gthread_mutex_lock (__mutex=0x62a00004fa98) at /usr/include/x86_64-linux-gnu/c++/8/bits/gthr-default.h:748 #3 0x0000555555caf710 in std::mutex::lock (this=0x62a00004fa98) at /usr/include/c++/8/bits/std_mutex.h:103 #4 0x0000555555e43ae2 in Brain::AddHate (this=0x61600010e980, entity=0x62a00004e200, hate=0) at ../WorldServer/NPC_AI.cpp:246 #5 0x0000555556080638 in Spawn::CheckEncounterState (this=0x62a000000200, victim=0x6280008e0100, test_auto_lock=false) at ../WorldServer/Spawn.cpp:3754 #6 0x0000555555ea9a30 in Entity::SpellHeal (this=0x62a000000200, target=0x62a00004e200, distance=2.43889618, luaspell=0x61500092bb00, heal_type="heal", low_heal=55, high_heal=65, crit_mod=0 '\000', no_calcs=false, custom_spell_name="") at ../WorldServer/Combat.cpp:702 #7 0x0000555555efa27f in EQ2Emu_lua_SpellHeal (state=0x61b000adb088) at ../WorldServer/LuaFunctions.cpp:1394 #8 0x0000555556220d39 in luaD_precall () #9 0x0000555556232cca in luaV_execute () #10 0x0000555556221005 in ccall () #11 0x000055555622107a in luaD_callnoyield () #12 0x0000555556237da1 in f_call () #13 0x000055555621fdd7 in luaD_rawrunprotected () #14 0x00005555562217c0 in luaD_pcall () #15 0x0000555556237e71 in lua_pcallk () #16 0x0000555555e22bb8 in LuaInterface::CallSpellProcess (this=0x620000000080, spell=0x61500092bb00, num_parameters=5 '\005', customFunction="cast") at ../WorldServer/LuaInterface.cpp:625 #17 0x0000555555dedb8a in SpellProcess::ProcessSpell (this=0x61e000152480, spell=0x61500092bb00, first_cast=true, function=0x0, timer=0x0, all_targets=false) at ../WorldServer/SpellProcess.cpp:557 #18 0x0000555555df3759 in SpellProcess::CastProcessedSpell (this=0x61e000152480, spell=0x61500092bb00, passive=false, in_heroic_opp=false) at ../WorldServer/SpellProcess.cpp:1689 #19 0x0000555555deb490 in SpellProcess::Process (this=0x61e000152480) at ../WorldServer/SpellProcess.cpp:196 #20 0x0000555555d01630 in ZoneServer::Process (this=0x628000004100) at ../WorldServer/zoneserver.cpp:1729 #21 0x0000555555d1f91d in ZoneLoop (tmp=0x628000004100) at ../WorldServer/zoneserver.cpp:7582 #22 0x00007ffff71b4fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486 #23 0x00007ffff501406f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 ```
Sign in to join this conversation.
Loading...
Cancel
Save
There is no content yet.