Reading crash dumps

Support forum for questions about compiling and running EQ2Emulator on Linux.

Moderator: Team Members

Post Reply
User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Reading crash dumps

Post by Gangrenous » Tue Jan 10, 2017 6:55 am

Is there any magic to reading a BT report? I am getting a random crash, only happens when no one is playing.

Code: Select all

#0  0x00007fff81b3a968 in ?? ()
I have the line of the dump, it is definitely code I have written but I am quickly running out of ideas. I have a mutex on the new vector, and a readlock on it.

Also, while I have C++ coders attention. If I am already iterating a collection, and want to iterate it again, do I need two readlocks? I am thinking that I already have a lock on it, why lock twice? Such as if I was iterating the spawn_list and want to iterate it again, comparing spawn against spawn. Something like that anyway. Of course that is very intensive so I am already only getting the spawns in the immediate area, otherwise you can really compound the number of loops.

And one more. I have always been unclear on this one. Take a line like this one, where you check against the existence of an object.

Code: Select all

if (assist && assist->IsNPC() && assist->EngagedInCombat() == false){
Is the entire line read in and checked? I am just curious if that could cause a null to crash the line? Does that need to be embedded like this?

Code: Select all

if (assist)
    if (assist->IsNPC() && assist->EngagedInCombat() == false){
Reading this, I guess I am correct, the entire line would not be evaluated?
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Reading crash dumps

Post by Jabantiz » Tue Jan 10, 2017 4:48 pm

The hex is the memory address the program crashed at I believe. I never really used Linux so I am not the best at debugging it, I mainly go by the couple of lines before that tell you the function and general area that caused the crash.

If you are looping through a list and within that loop you loop through it again then you only need the 1 read lock assuming you aren't modifying the list.

That if statement is read left to right, as soon as it hits a false it won't bother checking the rest and skip to the else or out of the if. So if for some reason assist is null then it won't even bother to check assist->IsNPC() and therefore avoid the null pointer crash.

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Reading crash dumps

Post by Gangrenous » Tue Jan 10, 2017 5:09 pm

IsNPC() is where it is crashing. I am able to reproduce the problem so I can get it fixed now. I will let you know
Resident Dirty Hippy

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests