[Freeciv-Dev] Re: (PR#10386) Civserver segfaults on consider_settler_act
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10386 >
Egor Vyscrebentsov via RT wrote:
> <URL: http://RT::WebBaseURL.not.configured:80/Ticket/Display.html?id=10386 >
>
> CVS 2004-09-29 21:07 +0400, Xaw client.
>
> Civserver segfaults in both saved and new games.
> Reproduced often. For this backtrace it was end of second turn of new game.
I can get a warning here under valgrind. The "best tile" value is never
initialized but is used in some LOG_DEBUG logs. In the old code this
resulted in logging of random integer values. In the new code this
results in logging of integer values located at random locations in
memory ;-). Both are buggy but now you can get a segfault (on your
system at least).
Can you confirm that this patch fixes it?
jason
Index: server/settlers.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/settlers.c,v
retrieving revision 1.204
diff -u -r1.204 settlers.c
--- server/settlers.c 29 Sep 2004 02:24:24 -0000 1.204
+++ server/settlers.c 29 Sep 2004 21:11:09 -0000
@@ -1505,7 +1505,7 @@
struct player *pplayer = city_owner(pcity);
struct unit *virtualunit;
int want;
- struct tile *best_tile;
+ struct tile *best_tile = NULL; /* May be accessed by freelog() calls. */
enum unit_activity best_act;
struct tile *ptile = pcity->tile;
struct ai_data *ai = ai_data_get(pplayer);
- [Freeciv-Dev] Re: (PR#10386) Civserver segfaults on consider_settler_action(),
Jason Short <=
|
|