Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2000:
[Freeciv-Dev] server crash fixes
Home

[Freeciv-Dev] server crash fixes

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] server crash fixes
From: Jeff Mallatt <jjm@xxxxxxxxxxxx>
Date: Wed, 01 Mar 2000 03:31:02 -0500

I finally had the server crash while I was emitting lots of debug!

This debug output led directly to the first, very simple patch to fix a
problem whereby when a boat fails an attack, it causes a core dump because
the code doesn't check for its death (boat-lost-segfault-fix-0.diff).

However, it so happened that the boat that caused the above crash was also
loaded with other units.  When the boat died, so did all its passengers.
After percolating up several calls, this could lead to the iterator in
ai_manage_units() having dangling pointers.  This is similar to the problem
with disbanding barbarian boats, which was fixed by changing to using
wipe_unit_safe().  Changing to wipe_unit_safe() in this case, however,
would be a *BIG* chore.

So, I settled for re-implementing ai_manage_units() in a way that, I hope,
will avoid all possible wipe_unit()-caused dangling pointer problems.  This
is the second patch (safer-ai_manage_units-0.diff).

I hope that these will resolve the ephemeral server crashes we've been
seeing, such as in PR#267.

Attachment: boat-lost-segfault-fix-0.diff
Description: Text document

Attachment: safer-ai_manage_units-0.diff
Description: Text document

jjm

[Prev in Thread] Current Thread [Next in Thread]