Trinitycore: [CRASH] Duplicate threat list entry being inserted - memory leak

Created on 5 Jan 2018  路  51Comments  路  Source: TrinityCore/TrinityCore

Description:
Trinity::Assert (file=file@entry=0x23e1240 "/Sources/src/server/game/Combat/ThreatManager.cpp", line=line@entry=687, function=function@entry=0x23e15f0 "PutThreatListRef", message=message@entry=0x23e1288 "!inMap && \"Duplicate threat list entry being inserted - memory leak!\"")

Current behaviour:
Believe related to threat system rewrite

(Right now crashing like hell)

Expected behaviour: Tell us what should happen instead

Steps to reproduce the problem:
Dont know

Branch(es): 3.3.5 / 6.x (Select the branch(es) affected by this issue)
3.3.5

TC hash/commit:
e0b609a178528995959e5ea54255a3f856e62913

TDB version:
335.63

Operating system:
Linux x64, Static

Branch-3.3.5a Comp-Core HasBacktrace

Most helpful comment

Bingo - with mirror images I can reproduce this.

_(or at least I was able to reproduce it once, and not since. heh.)_

All 51 comments

@Treeston

Any idea what's happening just prior to the crash? Seems like UB somewhere, that assertion should be impossible to trigger.

This assertion message is completely useless. You should change it to include some more info - don't forget that ASSERT accepts format arguments ASSERT(condition, format, args)

Good point. @n4ndo, would you mind going to ~5a9fdda~ fdacf12 since your population seems to be able to reproduce this with some consistency? Hopefully that'll shed some light on what's going on here.

Sure no problem, let me just arrive home and i give feedback.

@n4ndo what happened to further crash dumps?

@Treeston No problem here for about 1 day ( with 30-40 players )

Are you _sure_ the original crashes happened on e0b609a, and not some earlier rev?

Are you sure the original crashes happened on e0b609a, and not some earlier rev?

@tje3d

@Treeston Eveyrthing works fine, i have no problem for days.

.....I will assume you posted the incorrect commit hash in the original issue then. Closing.

Hello @Treeston i'm sorry, i put the correct commit hash, since this pased days was holydays, i was forced to revert up to 425b181544a21d2246fdf0261ba76a37e2510883 (can't leave the server crashing, right now almost 3 days without crash).

I go to update up to 57672fdf259d1106420e6a2c91f6f1b65b00fbc9 and tell you the results, sorry my delay.

Oh - apologies, confused you two. Re-opening until confirmation.

Ok, so, today i finally update to 274dede3dc89fa72ec1687d5ff454feba9849e47, and first crash:

Sources/src/server/game/Combat/ThreatManager.cpp:696 in PutThreatListRef ASSERTION FAILED:
  !inMap Duplicate threat reference at 0x7f538d790f40 being inserted on GUID Full: 0xf1300079aa000024 Type: Creature Entry: 31146  Low: 36 for GUID Full: 0xf1300079f0003099 Type: Creature Entry: 31216  Low: 12441 - memory leak!

Thanks, very helpful - will take a look.

Can you post assertion output + crash dump for these?

31216 is a target dummy...the plot thickens.

~3dcd49e~ b53cbf4 fixes a super edge case iterator invalidation that could _potentially_ be the cause of this. Could you update and report back?

sure @Treeston let me update again and i tell you the results.

@n4ndo have you updated to b53cbf4 yet? If yes, has this fixed the crashes?

Sorry @Treeston my delay, tomorrow i go to update and tell you the results.

Updated to latest rev 46e1e35, hitting the assert in ThreatManager::PutThreatListRef ThreatManager.cpp

Every time it has happened so far on my end is when a mage has used Mirror Image when attacking a target dummy, not sure if it is relevant or not though.

That's very interesting, @Foereaper. I'll take a look at that specific case when I find the time.

Yeah, just checked all the dumps I have so far, and they all point to creature ID 31216, which is Mirror Image

http://prntscr.com/i00bl0

@Treeston https://pastebin.com/WTTUChVv 5 duplicated crashes fo 6h ,uptime 1h.
rev https://github.com/TrinityCore/TrinityCore/commit/1c60af632888433b29a27bee76e82e96632d4096 clean tk (Unix, RelWithDebInfo, Static)

@Treeston any news???it's critical fail

Should have some time a bit later today.

Bingo - with mirror images I can reproduce this.

_(or at least I was able to reproduce it once, and not since. heh.)_

@Laintime @Foereaper @n4ndo 1847555 should fix the underlying issue here. Mirror Image AI is a tad naughty - but that's fine, and the core should handle it gracefully.

I couldn't reproduce it at all after this commit, so I believe this should fix the issue. Please report back.

@Treeston thanks!

@Laintime @Foereaper @n4ndo have any of you updated yet? Has this resolved the issue?

I have yet to get my test server back up and running, but will do so hopefully tomorrow, I'll let you know asap

@Treeston I put only today,we wait.

@Laintime @Foereaper @n4ndo any updates?

@Treeston yes,two days uptime.
Thank you)

Seems good so far!

@Treeston open issue https://pastebin.com/QGC8qEmu
rev https://github.com/TrinityCore/TrinityCore/commit/b8c281f497d5da2251b11ab09f182a23a5721a1c (TrinityCore branch) (Unix, RelWithDebInfo, Static)
crash :'(

npc_pet_mage_mirror_image::npc_pet_mage_mirror_imageAI::InitializeAI (this=0x7fff2953f000) at /home/source/TrinityCore/src/server/scripts/Pet/pet_mage.cpp:126

聽 聽 聽 聽 owner = <optimized out>

f*ing mirror images, how do they work

(but yeah, that's a release crashdump, not much info in there - any idea what caused it?)

No crash here so far, running debug though and will let you know if/when it happens

@Treeston CombatManager::IsInCombatWith (this=0x7fff175ce790, guid=...) at /home/source/azur/src/server/game/Combat/CombatManager.cpp:210
210 return (_pveRefs.find(guid) != _pveRefs.end()) || (_pvpRefs.find(guid) != _pvpRefs.end());

No find guid,maybe summon ads fo boss,no guid target die,crash

have you got the call stack?

what @Laintime posted is not a line that could ever crash in a debug context

@Treeston Tomorrow I'll put the debug on my server
Now I'm on a live branch without the combat manager

Well i update today up to e45d54d80e3faf253d9f54d14866aacc8d019169 and 20 crash until now.

Now i shows Creature::SelectVictim():

going to update to 8f71307e5619c8ef1801488812e20d07714fd733

Cordially

Yeah, see if 1acfefb fixes this.

@Laintime @Foereaper @n4ndo any updates since 1acfefb?

I haven't experienced anything at least

assuming fixed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jildor picture Jildor  路  3Comments

Keader picture Keader  路  3Comments

Rushor picture Rushor  路  3Comments

Tatara902 picture Tatara902  路  3Comments

Rochet2 picture Rochet2  路  3Comments