Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] Re: (PR#11388) AutoReply: pubserver crash in send_unit_inf
Home

[Freeciv-Dev] Re: (PR#11388) AutoReply: pubserver crash in send_unit_inf

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#11388) AutoReply: pubserver crash in send_unit_info_to_onlookers
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 7 Dec 2004 13:31:39 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=11388 >

- Crash was with version 1.306.2.3 of unittools.c.

- In frame 0 (send_unit_info_to_onlookers) pplayer is NULL.  This 
obviously causes a crash (pconn->observer == FALSE).  The crash is easy 
to avoid, and we should do so.  But is there another bug here?

- In frame 1 (send_unit_info) dest is NULL.  This means 
game.game_connections is passed in to send_unit_info_to_onlookers, 
causing the obvious crash if there's an unattached player.

- In frame 2 (city_support/generic_city_refresh) unit_owner() is called 
to find the unit owner that's passed in to send_unit_info. 
this_unit->owner is 0, meaning unit_owner() should return a valid player 
(unit_owner should never return NULL in any case).  So what could be 
happening?

- Frames 3-5 we see it is player 0 whose revolution has just finished 
(in turn 120).  New government is monarchy.

- However this is one odd piece of data:

(gdb) p game.players[0].connections
$34 = {list = {nelements = 1, head_link = 0x8951f18, tail_link = 0x8951f18}}
(gdb) p ((struct connection 
*)game.players[0].connections->list.head_link->dataptr)->player
$35 = (struct player *) 0x0
(gdb) p ((struct connection 
*)game.players[0].connections->list.head_link->dataptr)->username
$7 = "snailll", '\0' <repeats 24 times>
(gdb) p ((struct connection 
*)game.players[0].connections->list.head_link->dataptr)->observer
$8 = false

(gdb) p game.game_connections
$1 = {list = {nelements = 1, head_link = 0x88deb88, tail_link = 0x88deb88}}
(gdb) p game.nplayers
$2 = 6

(gdb) p ((struct connection 
*)game.game_connections->list.head_link->dataptr)->player->player_no
$5 = 1
(gdb) p ((struct connection 
*)game.game_connections->list.head_link->dataptr)->username
$6 = "Huo", '\0' <repeats 28 times>


which is odd.  game_connections includes only one connection, username 
Huo, attached to player 1.  But game.players[0].connections includes 
only one connection, username snaill, not attached to any player and not 
an observer.  So it seems the list of connections may be corrupted.

jason





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