TrinityCore icon indicating copy to clipboard operation
TrinityCore copied to clipboard

[GDB-Backtrace] SmartAI::EnterEvadeMode

Open Amit86 opened this issue 13 years ago • 95 comments

SmartAI::EnterEvadeMode

Link http://pastebin.com/bQA1tNnx hash d2cc278

Amit86 avatar Dec 15 '12 20:12 Amit86

I guess you used SmartEvent Reset and action SmartAction EnterEvadeMode? Those lines will help:

void SmartAI::EnterEvadeMode()
{
    // ... some code ...
    Reset();
}
void SmartAI::Reset()
{
    // ... some code ...
    GetScript()->OnReset();
}

Or in other words: On reset -> Evade. In evade: Reset. On reset -> Evade. In evade: Reset. On reset -> Evade. In evade: Reset. On reset -> Evade. In evade: Reset. On reset -> Evade. In evade: Reset. On reset -> Evade. In evade: Reset. On reset -> Evade. In evade: Reset. On reset -> Evade. In evade: Reset.

Gacko avatar Dec 29 '12 06:12 Gacko

Why close the issue? Link http://pastebin.com/ApvbHrHZ Hash 63b9a75

Amit86 avatar Dec 31 '12 09:12 Amit86

Did you even read my comment? Did you understand it? Please show me the SmartAI for this.

Gacko avatar Dec 31 '12 10:12 Gacko

This is my SmartAI::EnterEvadeMode()

void SmartAI::EnterEvadeMode()
{
    if (!me->isAlive())
        return;

    RemoveAuras();

    me->DeleteThreatList();
    me->CombatStop(true);
    me->LoadCreaturesAddon();
    me->SetLootRecipient(NULL);
    me->ResetPlayerDamageReq();

    GetScript()->ProcessEventsFor(SMART_EVENT_EVADE);//must be after aura clear so we can cast spells from db

    SetRun(mRun);
    if (HasEscortState(SMART_ESCORT_ESCORTING))
    {
        AddEscortState(SMART_ESCORT_RETURNING);
        ReturnToLastOOCPos();
    }
    else if (mFollowGuid)
    {
        if (Unit* target = me->GetUnit(*me, mFollowGuid))
            me->GetMotionMaster()->MoveFollow(target, mFollowDist, mFollowAngle);
    }
    else
        me->GetMotionMaster()->MoveTargetedHome();

    Reset();
}

void SmartAI::Reset()

void SmartAI::Reset()
{
    if (!HasEscortState(SMART_ESCORT_ESCORTING))//dont mess up escort movement after combat
        SetRun(mRun);
    GetScript()->OnReset();
}

Both functions are exactly as described on trinity Dont you want to make some kind of protection against crashes? I dont see any script thats using both reset functions, if you can help me find it why not

Amit86 avatar Dec 31 '12 10:12 Amit86

Amit, I meant the SQL.

Gacko avatar Dec 31 '12 10:12 Gacko

I can also comfirm it: http://pastebin.com/TLrDER6y Running on: edb90f957baa9d9bb83f447795459311 I first got this after updating from: 4065b17c94859a7e7e312c0db621d9990095201e So the problem might be there

It may not be related, but I got this console errors:

SmartScript::ProcessAction: Entry 83600 SourceType 9, Event 0, Link Event 1 not found or invalid, skipped.
SmartScript::ProcessAction: Entry 83600 SourceType 9, Event 1, Link Event 2 not found or invalid, skipped.
SmartScript::ProcessAction: Entry 83600 SourceType 9, Event 2, Link Event 3 not found or invalid, skipped.

SmartScript: Entry 36564 has events but no events added to list because of instance flags.
SmartScript: Entry 25471 has events but no events added to list because of instance flags.
SmartScript: Entry 25473 has events but no events added to list because of instance flags.
SmartScript: Entry 25472 has events but no events added to list because of instance flags.

gpascualg avatar Jan 03 '13 23:01 gpascualg

Confirmed, any temporary fix for this?

digz6666 avatar Jan 04 '13 11:01 digz6666

Crash in in SmartAI::EnterEvadeMode:

  • http://pastebin.com/v9r9JbyJ
  • http://pastebin.com/5yf1KuCz

Nano-GG avatar Jan 04 '13 16:01 Nano-GG

eh, confirm is useless without crash log ...

Vincent-Michael avatar Jan 13 '13 14:01 Vincent-Michael

enjoy http://pastebin.com/ZPgt6Mxu

Thanks, Amit

On Sun, Jan 13, 2013 at 5:00 PM, blub [email protected] wrote:

eh, confirm is useless without crash log ...

— Reply to this email directly or view it on GitHubhttps://github.com/TrinityCore/TrinityCore/issues/8679#issuecomment-12194643.

Amit86 avatar Jan 13 '13 15:01 Amit86

https://github.com/TrinityCore/TrinityCore/issues/8679#issuecomment-11774885

So, once again: I'm not interested in more crash logs, post the SAI please.

Gacko avatar Jan 13 '13 19:01 Gacko

@Gacko They don't know which SAI script is crashing it. However, "SELECT * FROM smart_scripts WHERE event_type = 25 AND action_type = 24;" returns 0 rows in a clean TDB, can you guys test it out and post your output here?

Subv avatar Jan 13 '13 20:01 Subv

... that's what my post was intended to.

Gacko avatar Jan 13 '13 21:01 Gacko

I have use it "SELECT * FROM smart_scripts WHERE event_type = 25 AND action_type = 24;" and return = 0 and I have the same crash.

burnham avatar Jan 13 '13 21:01 burnham

Missclick...

Gacko avatar Jan 13 '13 21:01 Gacko

SELECT * FROM smart_scripts WHERE event_type = 25 AND action_type = 24; gives null still had the crash toady, can provide crash logs if needed

Amit86 avatar Jan 14 '13 19:01 Amit86

We now, that this SQL returns an empty result on lastest DB. The problem is caused anywhere else. The crashlogs say it occurs in SmartAI::EnterEvadeMode called from ObjectGridStoper::Visit. Either the SAI crashed because of an action triggered on SMART_EVENT_EVADE or in combination with ObjectGridStoper::Visit or both. My first assumption also causes a crash but not this one.

It could be very helpful if you could find out WHICH SAI causes the problem... either with debug code or by own research.

Gacko avatar Jan 14 '13 20:01 Gacko

Wellcome to EAI -> SAI auto conversion....

vlad852 avatar Jan 15 '13 21:01 vlad852

@vlad852 probably not related.

Subv avatar Jan 15 '13 21:01 Subv

@Subv , Unfortunately, this is 99.9999% true. I have 300MB DB Errors log about SAI per 12H...

vlad852 avatar Jan 16 '13 08:01 vlad852