Complete.Org:
Mailing Lists:
Archives:
freeciv-dev:
March 2000: [Freeciv-Dev] server crash fixes |
[Freeciv-Dev] server crash fixes[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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.
boat-lost-segfault-fix-0.diff
safer-ai_manage_units-0.diff jjm
|