Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2005:
[Freeciv-Dev] Re: (PR#13789) remove game.game_connections: the resulting
Home

[Freeciv-Dev] Re: (PR#13789) remove game.game_connections: the resulting

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#13789) remove game.game_connections: the resulting core dump
From: "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 3 Dec 2005 18:16:01 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13789 >

#0  map_is_known_and_seen (ptile=0x83b6f2c, pplayer=0x0, vlayer=V_MAIN)
    at maphand.c:807
807       assert(BV_ISSET(ptile->tile_seen[vlayer], pplayer->player_no)
(gdb) bt
#0  map_is_known_and_seen (ptile=0x83b6f2c, pplayer=0x0, vlayer=V_MAIN)
    at maphand.c:807
#1  0x08063483 in server_remove_unit (punit=0x83acaa8) at unittools.c:1377
#2  0x080637a5 in wipe_unit (punit=0x83acaa8) at unittools.c:1472
#3  0x080a90be in city_build (pplayer=0x829c740, punit=0x83acaa8, 
    name=0x86be3a8 "Addis Abeba") at unithand.c:515
#4  0x080a4713 in ai_do_build_city (pplayer=0x829c740, punit=0x83acaa8)
    at settlers.c:84
#5  0x080a6985 in auto_settler_findwork (pplayer=0x829c740,
punit=0x83acaa8, 
    state=0xbfd70484, recursion=1) at settlers.c:1026
#6  0x080a6372 in auto_settler_findwork (pplayer=0x829c740,
punit=0x83acaa8, 
    state=0xbfd70484, recursion=0) at settlers.c:1143
#7  0x080a7240 in auto_settlers_player (pplayer=0x829c740) at
settlers.c:1280
#8  0x08051440 in end_phase () at srv_main.c:656
#9  0x08053381 in main_loop () at srv_main.c:1640
#10 0x0805359f in srv_main () at srv_main.c:1721
#11 0x0804ab89 in main (argc=135678478, argv=0xbfd78444) at civserver.c:242

This is reproduced by starting an AI game with finite timeout and
connecting to the server but not taking any player or observing. Eventually
some unit will die and this will happen. The attached patch fixes this
core, but I assume that other places in the codebase could be similarly
affected.

my original point stands I think: game.game_connections should never have
been removed. If the detached clients need certain information then the
server should send that information (like player info) to
game.est_connections. Nothing else should go to detached connections.

This patch needs to be reverted.

-mike

Index: server/unittools.c
===================================================================
--- server/unittools.c  (revision 11292)
+++ server/unittools.c  (working copy)
@@ -1375,7 +1375,8 @@
 
   conn_list_iterate(game.est_connections, pconn) {
     if ((!pconn->player && pconn->observer)
-       || map_is_known_and_seen(punit->tile, pconn->player, V_MAIN)) {
+       || (pconn->player 
+            && map_is_known_and_seen(punit->tile, pconn->player, V_MAIN))) {
       /* FIXME: this sends the remove packet to all players, even those who
        * can't see the unit.  This potentially allows some limited cheating.
        * However fixing it requires changes elsewhere since sometimes the

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