URL:
<http://gna.org/bugs/?17710>
Summary: tile->worked more than init_city_radius away not
zeroed for enemy cities
Project: Freeciv
Submitted by: cazfi
Submitted on: Sat 12 Feb 2011 01:47:49 AM EET
Category: client
Severity: 3 - Normal
Priority: 5 - Normal
Status: In Progress
Assigned to: cazfi
Originator Email:
Open/Closed: Open
Release:
Discussion Lock: Any
Operating System: None
Planned Release: 2.3.0, 2.4.0
_______________________________________________________
Details:
I've been investigating this valgrind report from experimental ruleset game:
==13818== Invalid read of size 8
==13818== at 0x558D20: tile_city (tile.c:81)
==13818== by 0x42C667: put_overview_tile_area (overview_common.c:117)
==13818== by 0x42C92B: overview_update_tile (overview_common.c:407)
==13818== by 0x42CEAD: refresh_overview_canvas (overview_common.c:355)
==13818== by 0x42A3CE: unqueue_mapview_updates (mapview_common.c:2434)
==13818== by 0x42B902: set_mapview_origin (mapview_common.c:628)
==13818== by 0x42BB8B: center_tile_mapcanvas (mapview_common.c:836)
==13818== by 0x414F39: do_move_unit (control.c:2096)
==13818== by 0x432B94: handle_unit_packet_common (packhand.c:1344)
==13818== by 0x433409: handle_unit_info (packhand.c:1155)
==13818== by 0x435C91: client_handle_packet (packhand_gen.c:142)
==13818== by 0x40C09D: client_packet_input (client_main.c:566)
==13818== by 0x411384: input_from_server (clinet.c:417)
==13818== by 0x405E03: gui_event_loop (gui_main.c:694)
==13818== by 0x406211: ui_main (gui_main.c:1057)
==13818== by 0x40C529: client_main (client_main.c:509)
==13818== by 0x83C4C4C: (below main) (libc-start.c:228)
==13818== Address 0x124a1d00 is 48 bytes inside a block of size 2,456
free'd
==13818== at 0x4C240FD: free (vg_replace_malloc.c:366)
==13818== by 0x4CA9F0: game_remove_city (game.c:232)
==13818== by 0x410190: client_remove_city (climisc.c:144)
==13818== by 0x4310A5: handle_city_short_info (packhand.c:890)
==13818== by 0x435D48: client_handle_packet (packhand_gen.c:103)
==13818== by 0x40C09D: client_packet_input (client_main.c:566)
==13818== by 0x411384: input_from_server (clinet.c:417)
==13818== by 0x405E03: gui_event_loop (gui_main.c:694)
==13818== by 0x406211: ui_main (gui_main.c:1057)
I now think that this is caused by the fact that client does not know city
radius for enemy cities, so it doesn't set ptile->worked further than
init_city_radius away from center correctly when city is removed.
Fixing this in S2_3 might require touching network protocol.
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?17710>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev