EOSERV Bug Tracker > Bug #183: PK Crash

Bug #183: PK Crash

PK Crash
ID #183
Submitter Hollows
Product EOSERV
Severity Critical
Status CLOSED, FIXED
Submitted 19th Nov 2012
Updated 1st Feb 2014
Related SVN Revisions
Rev# Date Description
r394 01 Feb 2014 22:34:40 UTC UTIL_FOREACH does not reference by default, PK no longer crashes (bug #183), GCC 4.6+ is now ...
Hollows Submitter 12 years, 2 weeks ago

Is it just me or does the server crash as soon as someone get's killed in PK (Normal combat, spells work fine).

Comments

Apollo 12 years, 2 weeks ago

Confirmed at elevated to critical.

Updated Severity to CRITICAL

Apollo 12 years, 2 weeks ago

Solved:

Character *character is never established. Change the appropriate lines in the boolean AttackPK to the following:

Character *character;

UTIL_FOREACH(this->characters, pkcharacter)

{

if (pkcharacter->mapid == this->id && !pkcharacter->nowhere && pkcharacter->x == target_x && pkcharacter->y == target_y)

{

character = pkcharacter;

Hollows Submitter 12 years, 2 weeks ago

Thanks apollo.

Sausage Developer 12 years, 1 week ago

I've seen crashes on death before (I think they were related to dropping all your items, and happened when NPCs killed you as well), but nothing recently. No clue what the redundant code Apollo posted above is supposed to solve...

Apollo 12 years, 1 week ago

Could be more efficient probably. For some reason it crashes for every character pointer starting with GetHome and below in that death sequence. Might have worked simply by adding if(character && to that if statement. It isn't related to drop all items though, but adding that redundant code definitely fixes whatever the underlying problem is.

Ryouken 11 years, 50 weeks ago

Its because the character is being removed from the map->characters container while it is being accessed.

Sausage Developer 10 years, 43 weeks ago

Confirmed crash, but none of the speculating in this thread so far seems correct.

Updated Status to CONFIRMED

Sausage Developer 10 years, 43 weeks ago

It does in fact appear to be caused by character being a Character*&, not just a Character*. The reference is presumably invalidated by the change to the container.

Apollo's fix will work, as it creates a copy of the pointer.

Sausage Developer 10 years, 43 weeks ago

Fixed in r394.

Updated Status to CLOSED, FIXED

Add Comment

Please don't post unless you have something relevant to the bug to say.
Do not comment to say "thanks" or "fix this please".

Please log in to add comments. EOSERV Bug Tracker > Bug #183: PK Crash