Item Deletion Incompatability?

Old bugs stored here for reference.
nyquist
Posts: 29
Joined: Wed Jun 25, 2008 5:25 am
Location: Raleigh, NC

Item Deletion Incompatability?

Post by nyquist » Tue Nov 11, 2008 6:38 pm

Ok, so I have finally pinpointed my segmentation fault. It occurs when I LOG OUT or ZONE; it is in a generic header file called "atomicity.h" (on my flavor of Ubuntu it lies in "/usr/include/c++/4.2/ext/").
Im running Ubuntu 8.04
EQ2Emu: Custom Build, slight tweak from SVN checked out on November 9th (maybe)
BACKTRACE #1 (for logging out)
#0 0x080aec3f in ~Item (this=0x82a91f0) at /usr/include/c++/4.2/ext/atomicity.h:51
#1 0x080aeed5 in ~PlayerItemList (this=0x82953d8) at Items.cpp:882
#2 0x08141140 in ~Player (this=0x8293d68) at Player.cpp:82
#3 0x080db186 in ~Client (this=0x85871f0) at client.cpp:158
#4 0x0815a394 in ZoneServer::ClientProcess (this=0x858d1a8) at zoneserver.cpp:1074
#5 0x081640e8 in ZoneServer::Process (this=0x858d1a8) at zoneserver.cpp:632
#6 0x08164395 in ZoneLoop (tmp=0x858d1a8) at zoneserver.cpp:2395
#7 0xb7c3a4fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#8 0xb7bbbe5e in clone () from /lib/tls/i686/cmov/libc.so.6
BACKTRACE #2 (whenever I zone)
#0 0x080aec3f in ~Item (this=0x82a91f0) at /usr/include/c++/4.2/ext/atomicity.h:51
#1 0x080aeed5 in ~PlayerItemList (this=0x82953d8) at Items.cpp:882
#2 0x08141140 in ~Player (this=0x8293d68) at Player.cpp:82
#3 0x080db186 in ~Client (this=0x85871f0) at client.cpp:158
#4 0x0815a394 in ZoneServer::ClientProcess (this=0x858d1a8) at zoneserver.cpp:1074
#5 0x081640e8 in ZoneServer::Process (this=0x858d1a8) at zoneserver.cpp:632
#6 0x08164395 in ZoneLoop (tmp=0x858d1a8) at zoneserver.cpp:2395
#7 0xb7c124fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#8 0xb7b93e5e in clone () from /lib/tls/i686/cmov/libc.so.6
The seg fault is thrown in the second line of the following code:
atomicity.h:50-51

Code: Select all

  __exchange_and_add(volatile _Atomic_word* __mem, int __val)
  { return __sync_fetch_and_add(__mem, __val);}
Which suggests that there is some problem with the atomic/mutexed operation that is going on in the final stages of the Item destructor.
If I have missed any important info...lemme know so I can post it!
(Edit made the code more clear and added full backtraces)
Last edited by nyquist on Thu Nov 13, 2008 12:40 am, edited 2 times in total.
--nyquist

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Tue Nov 11, 2008 9:39 pm

When I am messing around on Linux, LE usually asks me for the backtrace after using gdb to run the binary (I think that's it, there are other posts here of me crying about linux issues).
Maybe you can get one of those to add to your bug.

Image
Retired
Posts: 251
Joined: Sun Oct 26, 2008 10:07 am

Post by Image » Wed Nov 12, 2008 6:46 pm

I think it is trying to save the player (to the database) after it has been deconstructed, I will be able to test it this weekend.

nyquist
Posts: 29
Joined: Wed Jun 25, 2008 5:25 am
Location: Raleigh, NC

Post by nyquist » Thu Nov 13, 2008 12:07 am

I'm working on getting that back trace as soon as my test on Friday is past :)
Also, I have an update: it appears that ANY call to the Item destructor causes this same error, in the same external library, again, at the same line of code...don't know if this changes the diagnosis of the problem, but like I said, I will hopefully have that back trace by this weekend...
--nyquist

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Fri Nov 14, 2008 8:39 am

Could you please grab the Items.cpp file as-is from public SVN and paste the backtrace of the crash from it? The line numbers in your BTs are off and I cannot determine which line it is actually crashing on.
Thanks!

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Fri Nov 14, 2008 8:41 am

Oh one other thing. This could be caused by corrupt data. Could you also trying deleting everything from your character_items table?

nyquist
Posts: 29
Joined: Wed Jun 25, 2008 5:25 am
Location: Raleigh, NC

Post by nyquist » Fri Nov 14, 2008 2:35 pm

Alrighty, well I will try updating my items; but I'm not crashing in Items.cpp....I'm actually crashing in atomicity.h. Apparently when Items.cpp is in the process of returning to its calling function (~PlayerItemList), it segfaults...
But I will humor you and go ahead and update the Items.cpp
--nyquist

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Fri Nov 14, 2008 3:52 pm

Humor him?
I think if you ask for help from the dev, it is required to do as asked and not come off sounding all superior. Believe it or not, LE probably knows a little more about the code than you. Meh?
Sorry, that response just rubbed me wrong.

Image
Retired
Posts: 251
Joined: Sun Oct 26, 2008 10:07 am

Post by Image » Fri Nov 14, 2008 4:24 pm

You should see some of the exchanges between the qa,dev,support teams at my job John :)

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Nov 15, 2008 11:24 am

Oh I imagine... that has been my profession for 10 years now, QA/Design engineer. I am usually pretty respectful to my devs, until they put on the retard cap and do something really stupid. :)

nyquist
Posts: 29
Joined: Wed Jun 25, 2008 5:25 am
Location: Raleigh, NC

Post by nyquist » Sun Nov 16, 2008 2:46 pm

I didn't mean "humor you" in the way it apparently came out :P
I merely wanted to express the fact that I was not actually crashing in the area that we originally thought, but I would go ahead and complete the task (despite my further investigation)...
But, anyway, the back trace from the newest Item.cpp is as follows:

Code: Select all

#0  0x080aec72 in ~Item (this=0x82998f8) at /usr/include/c++/4.2/ext/atomicity.h:51
#1  0x080aee8a in ~PlayerItemList (this=0x82953d8) at Items.cpp:876
#2  0x08141500 in ~Player (this=0x8293d68) at Player.cpp:82
#3  0x080db546 in ~Client (this=0x85871f0) at client.cpp:158
#4  0x0815a754 in ZoneServer::ClientProcess (this=0x8592650) at zoneserver.cpp:1074
#5  0x081644a8 in ZoneServer::Process (this=0x8592650) at zoneserver.cpp:632
#6  0x08164755 in ZoneLoop (tmp=0x8592650) at zoneserver.cpp:2395
#7  0xb7bf24fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#8  0xb7b73e5e in clone () from /lib/tls/i686/cmov/libc.so.6
it seems the segfault is occuring in a c-plus-plus-ism in returning from the Items destructor... I no pro at C++ behind the scenes stuff....so anyone got any ideas?
--nyquist

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Mon Nov 17, 2008 3:48 pm

Yah no offense taken. Whenever an exception is thrown from included files outside of the project the most likely scenario is the project is causing it. In this cause I am almost certain that it is the Item destructor that is causing it. Did you ever try delete all the rows from your character_items table and seeing if it still crashed?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Mon Nov 17, 2008 10:06 pm

LethalEncounter wrote:Yah no offense taken
Fact: LE is a muccch nicer guy than me =)
Color me guard-dog.

nyquist
Posts: 29
Joined: Wed Jun 25, 2008 5:25 am
Location: Raleigh, NC

Post by nyquist » Thu Nov 20, 2008 11:10 pm

Ok, well I noticed that despite my efforts of deleting the items present in "character_items", every time I log my character in, he gets an endless bag of envy, thus I cannot exit without an item in my inventory.
Do you happen to know where that endless bag of envy is inserted into a character's inventory? (as in which .cpp file the bag creation code is) If not I should hopefully be able to find it on my own soon...
Btw, thanks for helping me debug this problem guys
--nyquist

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Thu Nov 20, 2008 11:46 pm

Check the starting_items table, by default I believe that is the only item new characters get. But once you create your toon, you should be able to delete it from character_items (your char_id) and it should not automatically return - unless there is some magic I am unaware of.

Locked

Who is online

Users browsing this forum: No registered users and 0 guests