This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bug: unit->busy flag doesn't get cleared


> I put in a debug warning for units that get their flag cleared at the end
> of turn. So finding the bug will be easy once you trigger it.

OK, I reproduced it.  Here's an excerpt from the log.  The unit was
newly created.  Maybe something in make_unit_complete or thereabouts
has some kind of race condition?

$ grep -E '(##### TURN|i 441|Busy flag)' ~/Xconq.DebugOut
. . .
##### TURN 38 (Turn  38) #####
##### TURN 39 (Turn  39) #####
s1 * 23 (8,27) (had 504) transfers 4 fuel to s1 i 441 (8,27,in23) (had 0) (0 to side)
s1 * 23 (8,27) (had 202) transfers 2 ammo to s1 i 441 (8,27,in23) (had 0) (0 to side)
s1 * 19 (9,26) (had 501) transfers 1 fuel to s1 i 441 (8,27,in23) (had 4) (0 to side)
s1 * 19 (9,26) (had 202) transfers 2 ammo to s1 i 441 (8,27,in23) (had 2) (0 to side)
s1 * 18 (8,26) (had 520) transfers 1 fuel to s1 i 441 (8,27,in23) (had 5) (0 to side)
s1 * 18 (8,26) (had 210) transfers 2 ammo to s1 i 441 (8,27,in23) (had 4) (0 to side)
s1 * 23 (8,27) doing [build "s1 i 441 (8,27,in23)" (#23)] with 1 acp left
s1 * 23 (8,27) action [build "s1 i 441 (8,27,in23)" (#23)] result is action-done, 0 acp left
##### TURN 40 (Turn  40) #####
s1 * 23 (8,27) doing [build "s1 i 441 (8,27,in23)" (#23)] with 1 acp left
s1 * 23 (8,27) action [build "s1 i 441 (8,27,in23)" (#23)] result is action-done, 0 acp left
##### TURN 41 (Turn  41) #####
s1 * 23 (8,27) doing [build "s1 i 441 (8,27,in23)" (#23)] with 1 acp left
s1 i 441 (8,27,in23) is completed
s1 * 23 (8,27) action [build "s1 i 441 (8,27,in23)" (#23)] result is build-completed, 0 acp left
  Moving s1 i 441 (8,27,in23) (0/1, buzz 0) with plan type Passive <null goal> supply_alarm no tasks
##### TURN 42 (Turn  42) #####
s1 @ 36 (9,24) (had 942) transfers 1 fuel to s1 i 441 (8,27,in23) (had 5) (0 to side)
Busy flag still set for 143947984 at start of turn.
  Moving s1 i 441 (8,27,in23) (0/1, buzz 0) with plan type Passive <null goal> waiting supply_alarm no tasks
s1 i 441 (8,27,in23) doing [enter "s1 * 18 (8,26)" (#441)] with 1 acp left
s1 i 441 (8,26,in18) action [enter "s1 * 18 (8,26)" (#441)] result is action-done, 0 acp left
##### TURN 43 (Turn  43) #####
##### TURN 44 (Turn  44) #####
##### TURN 45 (Turn  45) #####
##### TURN 46 (Turn  46) #####



Current directory is /home/kingdon/work/xconq/x11/
GNU gdb Red Hat Linux (5.1-1)
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
/home/kingdon/work/xconq/x11/1999: No such file or directory.
Attaching to program: /home/kingdon/work/xconq/x11/xconq, process 1999
Reading symbols [messages snipped] . . . /usr/lib/gconv/ISO8859-1.so
0x40376afe in __select () from /lib/i686/libc.so.6
Breakpoint 1 at 0x8130b0f: file tp.c, line 1895.
(gdb) cont
Continuing.

Breakpoint 1, net_prep_enter_action (unit=0x8963c8c, unit2=0x8963c8c, 
    unit3=0x81b5f1c) at tp.c:1895
Breakpoint 2 at 0x8130a87: file tp.c, line 1876.
(gdb) bt 8
#0  net_prep_enter_action (unit=0x8963c8c, unit2=0x8963c8c, unit3=0x81b5f1c)
    at tp.c:1895
#1  0x08123263 in advance_into_cell (side=0x833e990, unit=0x8963c8c, x=8, 
    y=26, other=0x81b5f1c, reason=0xbfffe0f8) at ui.c:2583
#2  0x0805ae2d in aux_move_dir (side=0x833e990, map=0x88c6d20, unit=0x8963c8c)
    at tkcmd.c:527
#3  0x0805ac90 in do_dir (side=0x833e990) at tkcmd.c:481
#4  0x08125e67 in execute_command (side=0x833e990, ch=98) at cmd.c:103
#5  0x0805270b in tk_interp_key (cldata=0x0, interp=0x81c0cc0, argc=6, 
    argv=0xbfffe1c0) at tkmain.c:2675
#6  0x4003d1a0 in TclInvokeStringCommand () from /usr/lib/libtcl.so.0
#7  0x40057bc1 in TclExecuteByteCode () from /usr/lib/libtcl.so.0
(More stack frames follow...)
(gdb) p *unit
$1 = {type = 0, id = 441, name = 0x0, number = 56, x = 8, y = 27, z = 0, 
  side = 0x833e990, origside = 0x833e990, hp = 1, hp2 = 1, cp = 4, cxp = 0, 
  morale = 0, transport = 0x81b6200, tracking = 0, supply = 0x896bdd0, 
  s_flow = 0, s_conn = 0, tooling = 0x0, opinions = 0x0, act = 0x8a5e0c8, 
  plan = 0x8a612e8, extras = 0x0, aihook = 0x0, occupant = 0x0, 
  nexthere = 0x0, prev = 0x8966db0, next = 0x81b8cc8, unext = 0x8967378, 
  prevx = -1, prevy = -1, transport_id = 0x81a96f0, flags = 0, size = 1, 
  reach = 0, usedcells = 0, maxcells = 1, curadvance = -1, population = 1, 
  production = 0x8a2c180, autobuild = 0, autoresearch = 0, autoplan = 0, 
  cp_stash = 0, buildingdone = 0, researchdone = 0, busy = 1}
(gdb) cont
Continuing.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]