Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bug Reports

Development::Bug Reports Post detailed bug reports and what you would like to see next in the emu here.

Reply
 
Thread Tools Display Modes
  #1  
Old 05-11-2014, 09:22 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default Possible Invalid Pointer Bug...

This thread is the result of this crash: http://wiki.eqemulator.org/i?M=Pastebin&Paste=ftJoFBpe

Plain and simple..I believe the cause is related to an early access of a Client property before it has been initialized.


The failure (most likely an 'Access Violation' error):

Code:
if(this->aa) {
    for (i = 0; i < MAX_PP_AA_ARRAY; i++) {	//iterate through all of the client's AAs
        if (this->aa[i]) {	// make sure aa exists or we'll crash zone
            aa_AA = this->aa[i]->AA;	//same as aaid from the aa_effects table
            aa_value = this->aa[i]->value;	//how many points in it
            if (aa_AA > 0 || aa_value > 0) {	//do we have the AA? if 1 of the 2 is set, we can assume we do
                //slots = database.GetTotalAALevels(aa_AA);	//find out how many effects from aa_effects table
                slots = zone->GetTotalAALevels(aa_AA);	//find out how many effects from aa_effects, which is loaded into memory
                if (slots > 0)	//and does it have any effects? may be able to put this above, not sure if it runs on each iteration
                    ApplyAABonuses(aa_AA, slots, newbon);	//add the bonuses
            }
        }
    }
}
The crash occurs on access to the structure pointer in the array.

This array ('aa') has not been assigned when this code tries to access the pointer. This only appears to occur when an AE spell goes off
in the vicinty of a client that has not 'FinishedLoading' (i.e., someone who has made contact with the zone server..but, not yet in-game.)

There may be some other occurrences where this happens..but, I did attempt a fix for this and am awaiting feedback.

If this does indeed fix the issue, we will probably need to address all of the entity list AE functions.


This entire check is the fix..I had to change the method checked in this commit due to a misunderstanding of the connection vs. client load state
naming conventions... (client load state = 'conn_state'; connection state = 'client_state' - go figure...)
https://github.com/EQEmu/Server/comm...4004a0ecd31801
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #2  
Old 05-12-2014, 03:46 AM
vsab's Avatar
vsab
Discordant
 
Join Date: Apr 2014
Location: United Kingdom
Posts: 276
Default

How much of a ballache would it be to rename those variables to something that won't catch someone out at a later date?
Reply With Quote
  #3  
Old 05-30-2014, 09:51 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Maybe KLS can rename those when he reworks the mob classes :P
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #4  
Old 08-16-2014, 10:16 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Ok..I did receive some feedback on this fix today...

It looks like it may have helped..though, I imagine there are some other places that similar changes need to be made.


Please keep this post in mind when tracing pointer-related crashes.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
Reply


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 02:32 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