URL:
<http://gna.org/bugs/?16797>
Summary: Segmentation fault in tile_city()
Project: Freeciv
Submitted by: syntron
Submitted on: Samstag 02.10.2010 um 11:23
Category: general
Severity: 3 - Normal
Priority: 5 - Normal
Status: None
Assigned to: None
Originator Email:
Open/Closed: Open
Release: trunk
Discussion Lock: Any
Operating System: None
Planned Release: 2.3.0
_______________________________________________________
Details:
It fails at
is_city_center(pcity, ptile)
which is a macro:
#define is_city_center(_city, _tile) (_city->tile == _tile)
The city tile pointer seems to be invalid at this point. The error happens
for different calls to the function so somethere some memory seems to be
overwritten.
Savefile attached (use './ser -F -f freeciv-T0271-Y01721-auto.sav.bz2')
#0 0x0000000000577629 in tile_city (ptile=0x1d6b290) at tile.c:78
pcity = (struct city *) 0x100000000
#1 0x00000000004e7219 in is_unit_reachable_at (defender=0x15461f0,
attacker=0x1d13010,
location=0x100000000) at combat.c:88
No locals.
#2 0x0000000000422f9b in kill_unit (pkiller=0x1d13010, punit=0x1d6b660,
vet=<value optimized out>)
at unittools.c:1855
punit2 = (struct unit *) 0x15461f0
punit2_index = 2
punit2_size = 3
i = <value optimized out>
pkiller_link = "[l tgt=\"unit\" id=1925 name=\"Howitzer\"
/]\000\000\000\000\000\000\000\000`��\001\000\000\000\000��,\001\000\000\000\000p>�\000\000\000\000\000��W\000\000\000\000\000`��\001\000\000\000\000#�N\000\000\000\000\000\017\000\000\000\000\000\000\000\025\000\000\000\000\000\000\000]\000\000\0009\002\000\000\r�W\000\000\000\000"
punit_link = "[l tgt=\"tile\" x=15
y=21]Spy[/l]\000\0200�\001\000\000\000\000\021�X\000\000\000\000\0000\000\000\0000\000\000\000\020\002\210,�\177\000\0000\001\210,�\177\000\000n�`\000\000\000\000\000\200\000\210,�\177\000\0009_V",
'\0' <repeats 13 times>,
"[\000\000\000\000\000\000\000\006{a\000\000\000\000\000�\207^\000\000\000\000"
pvictim = (struct player *) 0x1541ba0
pvictor = (struct player *) 0x153e010
ransom = <value optimized out>
unitcount = <value optimized out>
__FUNCTION__ = "kill_unit"
#3 0x00000000004b27ca in unit_attack_handling (punit=0x1d13010,
pdefender=0x1d6b660) at unithand.c:1103
winner_id = 1925
loser_link = "[l tgt=\"tile\" x=15
y=21]Spy[/l]\000��,\001\000\000\000\000\...@o\000\000\000\000\000\0200�\001\000\000\000\000u?o\000\000\000\000\000��,\001\000\000\000\000\032AO\000\000\000\000\000`��\001\000\000\000\000\0200�\001\000\000\000\000\036\000\000\000\000\000\000\000<\000\000\000K\000\000\000\001\000\000\000\021\000\000\000�aT\001\000\000\000"
winner_link = "[l tgt=\"unit\" id=1925 name=\"Howitzer\"
/]\0000�\001\000\000\000\000��,\001\000\000\000\000\202pn\000\000\000\000\...@�,\001\000\000\000\000�aT\001\000\000\000\000\002\000\000\000\001\000\000\000�aT\001",
'\0' <repeats 20 times>,
"\002\000\000\000\000\000\000\000AuN\000\000\000\000"
ploser = (struct unit *) 0x1d6b660
pwinner = (struct unit *) 0x1d13010
pcity = (struct city *) 0x0
moves_used = 0
def_moves_used = 0
old_unit_vet = 1
old_defender_vet = 0
vet = 0
winner_id = 1925
def_tile = (struct tile *) 0x12ce4e8
pplayer = (struct player *) 0x153e010
__FUNCTION__ = "unit_attack_handling"
#4 0x00000000004b1ded in unit_move_handling (punit=0x1d13010,
pdesttile=0x12ce4e8, igzoc=false,
move_diplomat_city=false) at unithand.c:1423
victim = <value optimized out>
pplayer = (struct player *) 0x153e010
pcity = (struct city *) 0x0
__FUNCTION__ = "unit_move_handling"
#5 0x000000000043614a in ai_unit_attack (punit=0x1d13010, ptile=0x12ce4e8)
at aitools.c:928
bodyguard = (struct unit *) 0x0
sanity = 1925
alive = <value optimized out>
__FUNCTION__ = "ai_unit_attack"
#6 0x0000000000442d9a in adv_unit_execute_path (punit=0x1d13010,
path=0x14d0f20) at advgoto.c:100
plr = <value optimized out>
ptile = (struct tile *) 0x12ce4e8
id = 1925
is_ai = true
i = 15
__FUNCTION__ = "adv_unit_execute_path"
#7 0x00000000004b7b1b in ai_military_rampage (punit=0x1d13010, thresh_adj=1,
thresh_move=1)
at aiunit.c:720
count = 6
path = (struct pf_path *) 0x14d0f20
__FUNCTION__ = "ai_military_rampage"
#8 0x00000000004ba420 in ai_military_attack (pplayer=0x153e010,
punit=0x1d13010) at aiunit.c:1803
dest_tile = <value optimized out>
id = 1925
ct = <value optimized out>
pcity = <value optimized out>
start_tile = (struct tile *) 0x12c4e58
__FUNCTION__ = "ai_military_attack"
#9 0x00000000004bbd87 in ai_manage_military (pplayer=0x153e010,
punit=0x1d13010) at aiunit.c:2148
id = 1925
__FUNCTION__ = "ai_manage_military"
#10 0x00000000004bdfa7 in ai_manage_unit (pplayer=0x153e010, punit=0x1d13010)
at aiunit.c:2333
bodyguard = (struct unit *) 0x0
is_ferry = <value optimized out>
__FUNCTION__ = "ai_manage_unit"
#11 0x00000000004beaad in ai_manage_units (pplayer=0x153e010) at
aiunit.c:2439
punit = (struct unit *) 0x1d13010
punit_index = 4
punit_size = 264
__FUNCTION__ = "ai_manage_units"
#12 0x000000000043aa69 in ai_do_first_activities (pplayer=0x153e010) at
aihand.c:482
No locals.
#13 0x000000000040cfdd in srv_main () at srv_main.c:668
__FUNCTION__ = "srv_main"
#14 0x00000000004040e9 in main (argc=8, argv=0x7fff2c880ee8) at
civserver.c:376
inx = 8
showhelp = false
showvers = false
option = <value optimized out>
__FUNCTION__ = "main"
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Samstag 02.10.2010 um 11:23 Name: freeciv-T0271-Y01721-auto.sav.bz2
Size: 28kB By: syntron
<http://gna.org/bugs/download.php?file_id=10544>
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?16797>
_______________________________________________
Nachricht geschickt von/durch Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev