Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10415) segfault in map_distance_vector() called from
Home

[Freeciv-Dev] (PR#10415) segfault in map_distance_vector() called from

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10415) segfault in map_distance_vector() called from ... ai_hunter_manage()
From: "Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx>
Date: Sun, 3 Oct 2004 00:59:36 -0700
Reply-to: rt@xxxxxxxxxxx

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


  This segfault happens in year 2020 with attached autogame, but only if 
game is not saved before (see #10359) I only tested saveturns=1, though. 
Freeciv version is "CVS Oct 2 08:31 EEST"


(gdb) bt full
#0  map_distance_vector (dx=0x22e7b0, dy=0x22e7b4, tile0=0x10209860, 
tile1=0x2)
     at ../../freeciv-src/common/map.c:1541
         dx = (int *) 0x22e7b0
         dy = (int *) 0x22e7b0
         tile0 = (const struct tile *) 0x10209860
         tile1 = (const struct tile *) 0x2
#1  0x004672a6 in real_map_distance (tile0=0x10209860, tile1=0x2)
     at ../../freeciv-src/common/map.c:649
         tile0 = (const struct tile *) 0x22e7b0
         tile1 = (const struct tile *) 0x22e7b0
         dx = 292010024
         dy = 0
#2  0x00468b48 in is_tiles_adjacent (tile0=0x10209860, tile1=0x2)
     at ../../freeciv-src/common/map.c:1277
         tile0 = (const struct tile *) 0x22e7b0
         tile1 = (const struct tile *) 0x22e7b0
#3  0x004d2bd2 in ai_hunter_manage (pplayer=0x5b02b0, punit=0x1167b828)
     at ../../freeciv-src/ai/aihunt.c:468
         pplayer = (struct player *) 0x5b02b0
         punit = (struct unit *) 0x1167b828
         target = (struct unit *) 0x115c9338
         sanity_own = 4996
         sanity_target = 4993
         sanity_own = 4996
         sanity_target = 4993
#4  0x004cdcc5 in ai_manage_military (pplayer=0x5b02b0, punit=0x1167b828)
     at ../../freeciv-src/ai/aiunit.c:2063
         pplayer = (struct player *) 0x5b02b0
         punit = (struct unit *) 0x1167b828
         id = 4996
#5  0x004ce484 in ai_manage_units (pplayer=0x5b02b0) at 
../../freeciv-src/ai/aiunit.c:2203
         _size = 449
#6  0x004056d8 in ai_start_turn () at 
../../freeciv-src/server/srv_main.c:469
         pplayer = (struct player *) 0x22e7b0
         i = 8
#7  0x004059af in begin_phase (is_new_phase=true) at 
../../freeciv-src/server/srv_main.c:542
         is_new_phase = true
         line = 5154147
#8  0x004078b5 in main_loop () at ../../freeciv-src/server/srv_main.c:1509
         eot_timer = (struct timer *) 0x10107b98
         save_counter = 445
         is_new_turn = true
#9  0x00407b5b in srv_main () at ../../freeciv-src/server/srv_main.c:1628
No locals.
#10 0x0040140f in main (argc=3, argv=0x10101c78) at 
../../freeciv-src/server/civserver.c:170
         argc = 3
         argv = (char **) 0x10101c78
         inx = 3
         showhelp = false
         showvers = false
         option = 0x22e7b0 "(¸g\021"


(gdb) frame 3
#3  0x004d2bd2 in ai_hunter_manage (pplayer=0x5b02b0, punit=0x1167b828)
     at ../../freeciv-src/ai/aihunt.c:468
468       if (is_tiles_adjacent(punit->tile, target->tile)) {


(gdb) p *punit
$3 = {type = 15, id = 4996, owner = 2, tile = 0x10209860, homecity = 
112, moves_left = 2,
   hp = 30, veteran = 0, unhappiness = 0, upkeep = 0, upkeep_food = 0, 
upkeep_gold = 0, fuel = 0,
   bribe_cost = -1, ai = {control = false, ai_role = AIUNIT_HUNTER, 
ferryboat = 0, passenger = 0,
     bodyguard = 0, charge = 0, prev_struct = 0x10209720, cur_struct = 
0x10209720,
     prev_pos = 0x1167b878, cur_pos = 0x1167b87c, target = 4993, hunted 
= 0},
   activity = ACTIVITY_IDLE, goto_tile = 0x0, activity_count = 0, 
activity_target = S_NO_SPECIAL,
   focus_status = FOCUS_AVAIL, ord_map = 0, ord_city = 0, foul = false, 
debug = false,
   moved = true, paradropped = false, done_moving = false, 
transported_by = -1, occupy = 0,
   client = {color = 0}, has_orders = false, orders = {length = 0, index 
= 0, repeat = false,
     vigilant = false, list = 0x0}}


(gdb) p unit_name(punit->type)
$4 = 0x61f0d0 "Mech. Inf."


(gdb) p idex_lookup_unit(punit->ai.target)
$5 = (struct unit *) 0x0


(gdb) p game.year
$9 = 2020



  - Caz

set savename huntersegf

set timeout -1
create Tester
set aifill 10
set saveturns 0
set endyear 2800
set startunits c
set generator 5

hard

set gameseed 1096738801
set mapseed  1246566352

start

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10415) segfault in map_distance_vector() called from ... ai_hunter_manage(), Marko Lindqvist <=