This is the mail archive of the xconq7@sourceware.cygnus.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]

problems with Big Commit!


On Tue, 1 Jun 1999, Stan Shebs wrote:

> Hi, for those of you following CVS, I've just committed a large pile of
> changes from Hans Ronne.  Most of the changes relate to Civ-type games,
> but he's also made some interesting changes to the AI that look like
> they'll result in more intelligent play.  So you might want to check
> them out...

int auto_pick_new_build_task() and int auto_pick_new_plan() are both
declared static in kernel/run.c.  However they are both referenced by
x11/xconq.c and so the compile files with a link error.

I'm not familiar enough with the code to fix it, but grep found it for
me :).

When I make the functions global scope I get a crash when trying to start
the Standard game(default options) just as the main screen appears.

console output:

text font is -family courier -size 12 -weight normal -slant roman
-underline 0 -overstrike 0
bold font is -family courier -size 12 -weight bold -slant roman -underline
0 -overstrike 0
Making fractal terrain; done.
Creating rivers (as borders); done.
Making countries; done.
Growing countries; done.
Making independents; done.
Adding geographical features; done.
Laying down roads; done.
Computing current view at each location; done.
Computing ranged and people views; done.
Assigning players to sides; done.
Setting up AIs; done.

Take over the world before you get taken over!
Fatal error encountered. Signal 11 code 0
Aborted (core dumped)

stack trace:

#0  0x40106111 in __kill ()
#1  0x40105d66 in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x40107447 in abort () at ../sysdeps/generic/abort.c:88
#3  0x8155986 in crash_handler (sig=11, code=0, scp=0x0, addr=0x2b "")
    at unix.c:340
#4  <signal handler called>
#5  0x4000c000 in _dl_show_auxv () at ../stdio-common/_itoa.h:49
#6  0x807dc7e in ai_update_plan (side=0x83c8230, unit=0x82c73dc) at
ai.c:204
#7  0x8107992 in execute_plan (unit=0x82c73dc, try=1) at plan.c:255
#8  0x80ab5cb in move_one_unit_multiple (unit=0x82c73dc, lim=1) at
run.c:848
#9  0x80aad75 in side_move_some_units (side=0x83c8230, lim=1) at run.c:702
#10 0x80aa99d in move_some_units (lim=1) at run.c:634
#11 0x80a9c51 in run_game (maxactions=1) at run.c:255
#12 0x812d748 in net_run_game (maxactions=1) at tp.c:243
#13 0x804f421 in tk_run_game (cldata=0x0, interp=0x82cefc8, argc=2, 
    argv=0xbfffefd0) at tkmain.c:948
#14 0x815770f in TclInvokeStringCommand (clientData=0x830f9a8, 
    interp=0x82cefc8, objc=2, objv=0x82cfc24) at
./../generic/tclBasic.c:1676
#15 0x8178dd9 in TclExecuteByteCode (interp=0x82cefc8, codePtr=0x842a3e8)
    at ./../generic/tclExecute.c:953
#16 0x81581e3 in Tcl_EvalObj (interp=0x82cefc8, objPtr=0x8340520)
    at ./../generic/tclBasic.c:2554
#17 0x81a27c1 in TclObjInterpProc (clientData=0x82f5c78, interp=0x82cefc8, 
    objc=1, objv=0x82cfc20) at ./../generic/tclProc.c:881
#18 0x8178dd9 in TclExecuteByteCode (interp=0x82cefc8, codePtr=0x85032a8)
    at ./../generic/tclExecute.c:953
#19 0x81581e3 in Tcl_EvalObj (interp=0x82cefc8, objPtr=0x82cf720)
    at ./../generic/tclBasic.c:2554
#20 0x8157fb3 in Tcl_Eval (interp=0x82cefc8, string=0x84497b8
"run_game_cmd")
    at ./../generic/tclBasic.c:2384
#21 0x8159ac0 in Tcl_GlobalEval (interp=0x82cefc8, 
    command=0x84497b8 "run_game_cmd") at ./../generic/tclBasic.c:3881
#22 0x81a3d00 in AfterProc (clientData=0x8449610)
    at ./../generic/tclTimer.c:1015
#23 0x81a3340 in TimerHandlerEventProc (evPtr=0x84fbaf8, flags=-3)
    at ./../generic/tclTimer.c:519
#24 0x819b6ea in Tcl_ServiceEvent (flags=-3) at
./../generic/tclNotify.c:440
#25 0x819b939 in Tcl_DoOneEvent (flags=-3) at ./../generic/tclNotify.c:679
#26 0x81b626c in Tk_MainLoop () at ./../generic/tkEvent.c:1036
#27 0x8050604 in ui_mainloop () at tkmain.c:1219
#28 0x804cea3 in main (argc=1, argv=0xbffffc54) at xconq.c:75
#29 0x400ffcb3 in __libc_start_main (main=0x804cdf0 <main>, argc=1, 
    argv=0xbffffc54, init=0x804ba34 <_init>, fini=0x8239f6c <_fini>, 
    rtld_fini=0x4000a350 <_dl_fini>, stack_end=0xbffffc4c)
    at ../sysdeps/generic/libc-start.c:78

code at #6: (failure starts at line 204)

199	{
200	    int (*fn) PARAMS ((Unit *unit));
201	
202	    fn = ((all_ai_ops[side->aitype])->to_update_plan);
203	    if (fn)
204	      return (*fn)(unit);
205	    else
206	      return FALSE;
207	}
208	

Key variables:

(gdb) print unit
$3 = (Unit *) 0x82c73dc
(gdb) print *unit
$4 = {type = 11, id = 7, name = 0x838c7e8 "Pagadian", number = 5, x = 46, 
  y = 13, z = 0, side = 0x83c8230, origside = 0x83c8230, hp = 20, hp2 =20,
  cp = 1, cxp = 0, morale = 0, transport = 0x0, tracking = 0,
  supply = 0x842e4d8, s_flow = 0, s_conn = 0, tooling = 0x0, opinions =0x0,
  act = 0x842e4f8, plan = 0x842e518, extras = 0x0, aihook = 0x0, uihook =0x0,
  occupant = 0x0, nexthere = 0x0, prev = 0x82c7008, next = 0x82c7468,
  unext = 0x82c7350, prevx = -1, prevy = -1, transport_id = 0x82b5f38,
  flags = 0, size = 1, reach = 2, usedcells = 0, maxcells = 1,
  curadvance = -1, population = 1, production = 0x842e4e8, autobuild = 1,
  autoresearch = 1, autoplan = 1, cp_stash = 0}

(gdb) print fn
$5 = (int (*)()) 0x80896e8 <mplayer_update_plan>
(gdb) list *fn
0x80896e8 is in mplayer_update_plan (mplayer.c:1868).

Line 1882 in mplayer_update_plan corrupted my console so I wasn't able to
trace the bug any further then this.  vi shows ~N's which ghex indicates
are 0x8E's!  I'm not sure what an 0x8E is doing in a comment but it does
make debugging painful.

Anyway, it's a fresh checkout as of 14:30 GMT+10 on a default RH6.0 box
running enlightenment, gnome, and a handful of gnome-terminals.  I used
the cvs tcl/tk libraries rather then the installed ones to avoid any
version mixup.

Hope this helps.

Andrae

P.S. Is this sort of thing appropriate for the list, or should I be
sending it privately?

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Andrae Muys              "Never ascribe to malice that which is adequately
andrae@humbug.org.au      explained by incompetence." - Napoleon Bonaparte


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