Death of an advanced unit

Hans Ronne hronne@pp.sbbs.se
Tue Jun 18 13:41:00 GMT 2002


>Recently, I sent a bug report that stated that in Xconq 7.4.1, I found
>that it segfaulted whenever an advanced unit was destroyed by something
>other than starvation.  I later reported that the problems stopped when
>I tried the CVS sources (7.5pre).  I have some new information now.
>
>It seems that the segfault occurs if an advanced unit is destroyed by
>something other than starvation (combat, hp-to-garrison, etc.), but not
>if the unit is under construction.  I think that Hans Ronne noted that
>the segfaults were most likely tied to terrain usage, which would
>explain why it doesn't segfault if the advanced units is incomplete (at
>that point, it's not using the terrain for anything).

This is weird. I checked to code, and terrain usage is always cleaned up
for advanced units irrespective of how they die. The same code is used in
all cases including starvation (kill_unit_aux). So this can't be the reason
for your crashes. Was this in the game where advanced units also were
mobile? As I mentioned earlier, the unit move code cannot yet handle
terrain usage, so if the unit first moves and then dies, we may end up with
NULL pointers being dereferenced.

The key question is therefore if you see this only with moving advanced units.

Hans

Hans Ronne

hronne@pp.sbbs.se




More information about the Xconq7 mailing list