Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] (PR#11358) server crash in aitools.c (bad assert?)
Home

[Freeciv-Dev] (PR#11358) server crash in aitools.c (bad assert?)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11358) server crash in aitools.c (bad assert?)
From: "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 5 Dec 2004 16:24:51 -0800
Reply-to: rt@xxxxxxxxxxx

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

(gdb) bt           
#0  0x400750a1 in kill () from /lib/libc.so.6
#1  0x40074e99 in raise () from /lib/libc.so.6
#2  0x40076364 in abort () from /lib/libc.so.6
#3  0x4006f15d in __assert_fail () from /lib/libc.so.6
#4  0x080ef3b3 in ai_unit_move (punit=0x8bead38, ptile=0x401dbfc8) at
aitools.c:509
#5  0x080ea995 in aiferry_gobyboat (pplayer=0x81f4b04, punit=0x8bead38,
dest_tile=0x401d03f8) at aiferry.c:457
#6  0x080eeca3 in ai_gothere (pplayer=0x81f4b04, punit=0x8bead38,
dest_tile=0x401d03f8) at aitools.c:235
#7  0x0808a053 in auto_settler_findwork (pplayer=0x81f4b04,
punit=0x8bead38) at settlers.c:1100
#8  0x0808a78f in auto_settlers_player (pplayer=0x81f4b04) at
settlers.c:1312
#9  0x0804e321 in end_phase () at srv_main.c:585
#10 0x0804f827 in main_loop () at srv_main.c:1589
#11 0x0804f9ad in srv_main () at srv_main.c:1666
#12 0x0804a5c4 in main (argc=12, argv=0xbfffefd4) at civserver.c:196
#13 0x400641c4 in __libc_start_main () from /lib/libc.so.6

(gdb) fr 4
#4  0x080ef3b3 in ai_unit_move (punit=0x8bead38, ptile=0x401dbfc8) at
aitools.c:509
509       assert(unit_owner(punit)->ai.control);

(gdb) p punit->owner
$18 = 1

(gdb) p game.players[1].ai.control
$20 = false

(gdb) p punit->ai
$17 = {control = true, ai_role = AIUNIT_BUILD_CITY, ferryboat = 537,
passenger = 0, bodyguard = 0, charge = 0, prev_struct = 0x401dd828,
cur_struct = 0x401dd828, 
  prev_pos = 0x8bead88, cur_pos = 0x8bead8c, target = 0, hunted = 0}


I think the assert is wrong. It should be 

  assert(punit->ai.control);

instead.

Note: I also see the same assert above in ai_unit_attack() It probably is
wrong too.

Jason notes:

<jdorje> ai_unit_move shouldn't be called for non-ai players I think
<kauf> but it does for auto settlers
<jdorje> it shouldn't
<jdorje> the autosettler is trying to find a ferry
<kauf> well...
<jdorje> this is wrong

-mike





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