Complete.Org: Mailing Lists: Archives: freeciv-dev: December 1999:
[Freeciv-Dev] infinite loop in barbarian leader goto? (PR#189)
Home

[Freeciv-Dev] infinite loop in barbarian leader goto? (PR#189)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] infinite loop in barbarian leader goto? (PR#189)
From: Greg Wooledge <wooledge@xxxxxxxxxxx>
Date: Wed, 8 Dec 1999 10:14:33 -0800 (PST)

While playing the CVS version (Dec. 6 snapshot), the client appeared to
be locked up.  I checked top and found that the civserver appeared to be
running away.  I attached gdb to the running civserver, and got this
stack trace:

#0  could_unit_move_to_tile (punit=0x82a4218, x0=85, y0=18, x=84, y=19)
    at gotohand.c:351
#1  0x80588b6 in goto_tile_cost (pplayer=0x8221a68, punit=0x82a4218, x0=85, 
    y0=18, x1=84, y1=19, m=4) at gotohand.c:375
#2  0x8058dbf in find_the_shortest_path (pplayer=0x8221a68, punit=0x82a4218, 
    dest_x=83, dest_y=19) at gotohand.c:468
#3  0x8059cce in do_unit_goto (pplayer=0x8221a68, punit=0x82a4218)
    at gotohand.c:748
#4  0x806ccde in auto_settler_do_goto (pplayer=0x8221a68, punit=0x82a4218, 
    x=83, y=19) at settlers.c:744
#5  0x80a06fa in ai_manage_barbarian_leader (pplayer=0x8221a68, 
    leader=0x82a4218) at aiunit.c:1897
#6  0x80a00cd in ai_manage_unit (pplayer=0x8221a68, punit=0x82a4218)
    at aiunit.c:1679
#7  0x80a017a in ai_manage_units (pplayer=0x8221a68) at aiunit.c:1706
#8  0x8099aac in ai_do_first_activities (pplayer=0x8221a68) at aihand.c:113
#9  0x8052bb0 in ai_start_turn () at civserver.c:744
#10 0x80522e1 in main (argc=1, argv=0xbffffcb4) at civserver.c:484

I let it run (continue) for a little while, then stopped it again:

#0  0x400a6724 in write () from /lib/libc.so.6
#1  0x80ce800 in connections ()
#2  0x808ad39 in send_connection_data (pc=0x80ce800, data=0xbfffe96c "", 
    len=24) at packets.c:3049
#3  0x80877ea in send_packet_unit_info (pc=0x80ce800, req=0xbffff9a8)
    at packets.c:1551
#4  0x80790f0 in send_unit_info (dest=0x0, punit=0x82a4218, dosend=0)
    at unitfunc.c:1972
#5  0x8059dde in do_unit_goto (pplayer=0x8221a68, punit=0x82a4218)
    at gotohand.c:771
#6  0x806ccde in auto_settler_do_goto (pplayer=0x8221a68, punit=0x82a4218, 
    x=83, y=19) at settlers.c:744
#7  0x80a06fa in ai_manage_barbarian_leader (pplayer=0x8221a68, 
    leader=0x82a4218) at aiunit.c:1897
#8  0x80a00cd in ai_manage_unit (pplayer=0x8221a68, punit=0x82a4218)
    at aiunit.c:1679
#9  0x80a017a in ai_manage_units (pplayer=0x8221a68) at aiunit.c:1706
#10 0x8099aac in ai_do_first_activities (pplayer=0x8221a68) at aihand.c:113
#11 0x8052bb0 in ai_start_turn () at civserver.c:744
#12 0x80522e1 in main (argc=1, argv=0xbffffcb4) at civserver.c:484

It appears to be stuck on this unit (0x82a4218), which is a barbarian
leader.  Here's the *punit:

(gdb) print *punit
$3 = {type = 51, id = 2114, owner = 10, x = 84, y = 19, veteran = 0, 
  homecity = 0, moves_left = 3, hp = 10, unhappiness = 0, upkeep = 0, 
  upkeep_food = 0, upkeep_gold = 0, foul = 0, fuel = 2, bribe_cost = -1, ai = {
    control = 0, ai_role = 0, ferryboat = 0, passenger = 0, bodyguard = 0, 
    charge = 0}, activity = ACTIVITY_IDLE, goto_dest_x = 83, goto_dest_y = 19, 
  activity_count = 0, activity_target = 0, focus_status = FOCUS_AVAIL, 
  ord_map = 0, ord_city = 0, moved = 1, paradropped = 0}

I hope this is helpful.

(Game details: set xsize 120, set ysize 75, set aifill 9, hard.  I'm the
only human player.)

(Platform details: Debian GNU/Linux unstable, x86, kernel 2.2.13,
glibc 2.1.2, libgtk 1.2.6, using GTK client, server running on localhost.
Compiled with gcc 2.95.2.)


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