Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: (PR#2468) core dump
Home

[Freeciv-Dev] Re: (PR#2468) core dump

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Christian Knoke <chrisk@xxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2468) core dump
From: "Raimar Falke via RT" <rt@xxxxxxxxxxxxxx>
Date: Tue, 17 Dec 2002 05:03:08 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Sun, Dec 01, 2002 at 11:22:49AM -0800, Guest via RT wrote:
> 
> 1.14beta CVS 01 DEC 2002 Gtk 1.2
> 
> Got core dump in civclient after conquering some cities.

Christian: this is not the big error I promised

> #0  0x080d2346 in improvement_redundant (pplayer=0x81e7908, pcity=0x8418fc8,
> id=7, 
>     want_to_build=0) at improvement.c:386
> #1  0x080cfa13 in update_all_effects () at game.c:1082
> #2  0x08072891 in try_update_effects (need_update=1) at packhand.c:268
> #3  0x0807389e in handle_short_city (packet=0x83d87a8) at packhand.c:643
> #4  0x08062ffc in handle_packet_input (packet=0x83d87a8, type=83) at 
> civclient.c:303

We got this short city info packet:
(gdb) p *packet
$23 = {id = 116, owner = 0, x = 8, y = 10, name = 
"Berlin\0g\0\0a\08\0\0\0\0\0\0\0\001\0\0\0\004\0\0\0\0\0\0", size = 6,
  happy = 1, capital = 1, walls = 1, tile_trade = 0}

At the time we call improvement_redundant the map tile is:
(gdb) p map.tiles[10*40+8]
$24 = {terrain = T_PLAINS, special = 10, city = 0x8349280, units = {list = 
{nelements = 3, null_link = {next = 0x83bdd98,
        prev = 0x83bdd98, dataptr = 0x0}, head_link = 0x83e5110, tail_link = 
0x83f07e0}}, known = 0, sent = 0, assigned = 0,
  worked = 0x0, continent = 25632, move_cost = "\0\006y\006y\0\006"}

You see two problems here: continent is too large: this will cause
fill_ranges_improv_lists to return an invalid pointer here:
      implist[EFR_ISLAND] = &pplayer->island_improv[cont*game.num_impr_types];

The reason is probably this: known = 0. So got an infomation about a
city but we don't know the tile beneath the city. This confuses the
client badly. I have no idea what may caused this. I'm for adding an
assert at the client and audit all server code to ensure that the tile
information is known to the client if the server sends a short city
info.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  Two OS engineers facing a petri net chart:
        "dead lock in four moves!"




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