Page 1 of 1

New Error

Posted: Tue Jun 14, 2016 8:13 pm
by Gangrenous
Somehow, not sure how but I have my server running in Debian pretty damned reliable. Most of my previous issues have vanished. I did get this one error while doing tons of zoning today.
Capture.JPG
Even stranger is that the server completely crashed, down to a prompt. When I zoned back in there was a duplicate of my player and I could not move around.

Re: New Error

Posted: Tue Jun 14, 2016 8:15 pm
by Jabantiz
That is a deadlock, but it is likely the result of that "Got Signal 11" which usually refers to memory corruption

Re: New Error

Posted: Thu Jun 23, 2016 5:21 pm
by Gangrenous
Not sure if this is exactly crash related or a result of the crash. I am guessing 8,388,607 is a medium int max? There is definitely significance to the number.
Capture.JPG

Re: New Error

Posted: Thu Jun 23, 2016 5:50 pm
by Jabantiz
That is to large to be the max for an int16 and to small to be the max for a sint32, either way there is clearly some sort of memory corruption messing with your factions.

How are factions set up on your server? I mean do you have agro working and players changing faction values? Are NPC's fighting each other?

Re: New Error

Posted: Thu Jun 23, 2016 6:09 pm
by Gangrenous
Digging into it more now. I can say this, not crash related. It is faction 12, 13, 15, 17 and 356 every single time just from logging out.

Re: New Error

Posted: Thu Jun 23, 2016 6:14 pm
by Gangrenous
It is something about the player having a negative faction. If I set any faction on my character to a 1 and logout, it stays at 1. If I set one to -1 and log out, it goes to 8388607

Re: New Error

Posted: Thu Jun 23, 2016 6:17 pm
by Jabantiz
provocating wrote:I am guessing 8,388,607 is a medium int max?
My mistake, you are correct on this being the max for a medium int in sql, I forgot sql and c++ data types don't match.

And thanks for that, should help me narrow it down some what, might be an issue in how it saves into the database.

Re: New Error

Posted: Thu Jun 23, 2016 6:32 pm
by Jabantiz
I don't see anything wrong with saving but you could try changing %li to %i in void WorldDatabase::SavePlayerFactions(Client* client)

Change this line

Code: Select all

query.RunQuery2(Q_INSERT, "insert into character_factions (char_id, faction_id, faction_level) values(%u, %u, %li) ON DUPLICATE KEY UPDATE faction_level=%li", client->GetCharacterID(), itr->first, itr->second, itr->second);	
to

Code: Select all

query.RunQuery2(Q_INSERT, "insert into character_factions (char_id, faction_id, faction_level) values(%u, %u, %i) ON DUPLICATE KEY UPDATE faction_level=%i", client->GetCharacterID(), itr->first, itr->second, itr->second);	
It is the same but Linux had issues with %l in the pas so it might be the issue again, maybe.

Re: New Error

Posted: Thu Jun 23, 2016 8:01 pm
by Gangrenous
Bingo, make this official please. Changing my SVN also.

Re: New Error

Posted: Thu Jun 23, 2016 8:04 pm
by Jabantiz
Yea I will put it on dev svn, and do a quick pass to get any other %li, just wasn't sure that was the problem as I couldn't reproduce it on windows, thanks for verifying it.