Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes, crashes everywhere..but, not a mob to think? #219

Closed
Uleat opened this issue Aug 24, 2014 · 1 comment
Closed

Crashes, crashes everywhere..but, not a mob to think? #219

Uleat opened this issue Aug 24, 2014 · 1 comment

Comments

@Uleat
Copy link
Contributor

Uleat commented Aug 24, 2014

There are a lot of random crash reports..but, not a lot of references that point to the cause...

Here is one from 2009: http://www.eqemulator.org/forums/showthread.php?t=37449&highlight=zone+crash+dump

And, of course, (one of) Akkadius's EZ server crash lists: http://wiki.eqemulator.org/i?M=Pastebin&Paste=d5sv9C8A (expires)

I did find a way to reliably reproduce these crashes..I chose 'firiona' due to there being opposing factions and I knew there would be some npc-on-npc action.

Basically, at the #zone-in point, doing a '#invul on -> #aggrozone -> -> #zoneshutdown firiona' will cause any of a series of crashes.

(I actually tried some hit-and-miss stuff in the beginning and found that I had two bug paths..A->B->D and A->C->D. regardless of the order, I still arrived at the same end point.)

I wasn't comfortable with the fact the hate was changing during zone shutdown, so I added code to the beginning of Zone::ShutDown() to turn off mob ai and to clear its aggro... (Later I found that a Wipe() is called in Mob::AI_Stop(), so I removed that.)

This led to a number of crashes going away..but, new ones crept in. (I also added a missing ';' in Mob::AI_Stop() and that appeared to have helped as well.)

(At this point, I had to define 'Zone::IsLoaded() { return ZoneLoaded;}' to get the next portion to work. I'm uncomfortable with using this since it's file scope..and I don't understand its use between instances..but, it does work in a test environment.)

My next crash was in '..\zone\quest_parser_collection.cpp:QuestParserCollection::GetQIByPlayerQuest(std::string &filename)'

The first line of code here is to check 'if(!zone)' and return nullptr.

the problem is that zone is defined..but, in a closing state. I added '|| !zone->IsLoaded()' because ShutDown() has just set 'ZoneLoaded' to false.

This is where non-apparent zone shut-down crashes are occurring. The are being processed after the shut down call thread is processed and are, likely, processed timers.

This fixed the 'GetQIByPlayerQuest' crash..but, still others were creeping in. So, I did a grepwin search for '(!zone' and found 8 more occurences and fixed those. (I have since gone back and found a lot of inclusion checks (i.e., 'if(zone)') that will probably need to be addressed similarly..weather check is one...)

I was still getting the occasional hate crash..so, I went into Mob::AI_Stop() and 'safe_deleted' the 3 pathing timers and 'Disabled()' ALL hard-coded timers and iterated SpecialAbilities[] to disable those as well.

It helped some more..but, no cigar...

The next two crashes were here:
https://github.com/EQEmu/Server/blob/master/zone/client_process.cpp#L698
and
https://github.com/EQEmu/Server/blob/master/ucs/clientlist.cpp#L626

And that's about where I am... Comments welcomed and here's a copy of my current test code:
http://wiki.eqemulator.org/i?Module=Pastebin&Paste=ZdfMAHUI

@Uleat
Copy link
Contributor Author

Uleat commented Aug 25, 2014

Please keep this issue open until resolution is verified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants