Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bots

Development::Bots Forum for bots.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-15-2018, 10:04 AM
irongut_av's Avatar
irongut_av
Fire Beetle
 
Join Date: Sep 2018
Posts: 20
Default Periodic Client XTargeting crash w/bots and large pulls

I have the latest source, and see an infrequent crash in some zones when the bot owner client aggro list gets large. Client::AddAutoXTarget has a comment that "IT IS NOT SAFE TO CALL THIS IF IT'S NOT INITIAL AGGRO", perhaps with bots and large pulls / train of mobs pushes the iterator too high.

Code:
[11-13-2018 :: 23:57:32] [Crash] EXCEPTION_ACCESS_VIOLATION
...

[11-13-2018 :: 23:57:33] [Crash] g:\eq\server\zone\client.cpp (7376): Client::AddAutoXTarget 
[11-13-2018 :: 23:57:33] [Crash] g:\eq\server\zone\attack.cpp (2993): Mob::AddToHateList 
[11-13-2018 :: 23:57:33] [Crash] g:\eq\server\zone\aggro.cpp (520): EntityList::AIYellForHelp 
[11-13-2018 :: 23:57:33] [Crash] g:\eq\server\zone\npc.cpp (815): NPC::Process 
[11-13-2018 :: 23:57:33] [Crash] g:\eq\server\zone\entity.cpp (487): EntityList::MobProcess 
[11-13-2018 :: 23:57:33] [Crash] g:\eq\server\zone\net.cpp (511): <lambda_1c9bf3832c89b368be380b0fbdc8d329>::operator() 
[11-13-2018 :: 23:57:33] [Crash] c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.15.26726\include\functional (15732480): std::_Func_impl_no_alloc<<lambda_1c9bf3832c89b368be380b0fbdc8d329>,void,EQ::Timer *>::_Do_call 
[11-13-2018 :: 23:57:33] [Crash] g:\eq\server\common\event\timer.h (39): <lambda_4a62a3c5557233412b20b69a12aafc23>::<lambda_invoker_cdecl> 
[11-13-2018 :: 23:57:33] [Crash] g:\eq\server\libs\libuv\src\win\timer.c (193): uv_process_timers 
[11-13-2018 :: 23:57:33] [Crash] g:\eq\server\libs\libuv\src\win\core.c (496): uv_run 
[11-13-2018 :: 23:57:33] [Crash] g:\eq\server\zone\net.cpp (538): main 
[11-13-2018 :: 23:57:33] [Crash] f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (288): __scrt_common_main_seh 
[11-13-2018 :: 23:57:33] [Crash] ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 7664343D) 
[11-13-2018 :: 23:57:33] [Crash] 7664343D (kernel32): (filename not available): BaseThreadInitThunk 
[11-13-2018 :: 23:57:33] [Crash] ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 77479802) 
[11-13-2018 :: 23:57:33] [Crash] 77479802 (ntdll): (filename not available): RtlInitializeExceptionChain 
[11-13-2018 :: 23:57:33] [Crash] ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 774797D5) 
[11-13-2018 :: 23:57:33] [Crash] 774797D5 (ntdll): (filename not available): RtlInitializeExceptionChain
Reply With Quote
  #2  
Old 11-15-2018, 08:47 PM
prestanneth
Fire Beetle
 
Join Date: Jul 2015
Posts: 25
Default

More than 20 perchance?

You could try adding ->AddAutoXTarget(this ,false);
rather than spamming the call but the MaxXTargets might be the problem..
Reply With Quote
  #3  
Old 11-26-2018, 03:13 PM
irongut_av's Avatar
irongut_av
Fire Beetle
 
Join Date: Sep 2018
Posts: 20
Default

I tried both solutions, and the crashes continued.

Finally found out what is causing the crash: the very small time that bots and bot pets remain in the zone after a client is killed.

Adding a these checks to attack.cpp stoped all crashes with bots and large pulls / train deaths:

Code:
#ifdef BOTS
// if other is a bot, add the bots client to the hate list
if(
other->IsBot() 
&& other->CastToBot()->GetBotOwner()  // valid pointer
&& other->CastToBot()->GetBotOwner()->InZone() // is in zone
&& !other->CastToBot()->GetBotOwner()->CastToClient()->IsDead() // isn't dead from the train
)
{

// do stuff to add aggro to bot owning client
}
Reply With Quote
  #4  
Old 11-26-2018, 09:10 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Can you specify a line number per: https://github.com/EQEmu/Server/blob...ne/attack.cpp?
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #5  
Old 11-27-2018, 02:32 PM
irongut_av's Avatar
irongut_av
Fire Beetle
 
Join Date: Sep 2018
Posts: 20
Default

https://github.com/EQEmu/Server/blob...ack.cpp?#L2697
Reply With Quote
  #6  
Old 11-27-2018, 08:10 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Quote:
[11-11-2018 :: 08:47:10] [Crash] c:\git-eqemusource\server\zone\client.cpp (7376): Client::AddAutoXTarget
[11-11-2018 :: 08:47:10] [Crash] c:\git-eqemusource\server\zone\attack.cpp (2711): Mob::AddToHateList
[11-11-2018 :: 08:47:10] [Crash] c:\git-eqemusource\server\zone\spell_effects.cpp (3482): Mob::DoBuffTic
[11-11-2018 :: 08:47:10] [Crash] c:\git-eqemusource\server\zone\spell_effects.cpp (3386): Mob::BuffProcess
[11-11-2018 :: 08:47:10] [Crash] c:\git-eqemusource\server\zone\npc.cpp (670): NPC::Process
[11-11-2018 :: 08:47:10] [Crash] c:\git-eqemusource\server\zone\entity.cpp (487): EntityList::MobProcess
I had a singular crash that led me to that exact code segment. (Happened during a client death..)

I'll look over what you posted and see what can be done.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #7  
Old 12-19-2018, 07:16 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

I re-worked it a little..but, I did finally push your change - thanks!!
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:28 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3