Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2001:
[Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/g
Home

[Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/g

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/games/9688
From: Thue <thue@xxxxxxx>
Date: Fri, 6 Apr 2001 00:01:17 +0200

On Thursday 05 April 2001 23:48, Thue wrote:
> And the real trace, generated again the CVS server binary:
>
> bash-2.04$ gdb server/civserver /home/freeciv/httpd/htdocs/games/9688/core
> GNU gdb 5.0
> Copyright 2000 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"...
> Core was generated by `/home/freeciv/src/freeciv/server/civserver --gamelog
> gamelog -p 5570 -m -r /hom'.
> Program terminated with signal 11, Segmentation fault.
> Reading symbols from /usr/lib/libz.so.1...done.
> Loaded symbols for /usr/lib/libz.so.1
> Reading symbols from /lib/libc.so.6...done.
> Loaded symbols for /lib/libc.so.6
> Reading symbols from /lib/ld-linux.so.2...done.
> Loaded symbols for /lib/ld-linux.so.2
> Reading symbols from /lib/libnss_files.so.2...done.
> Loaded symbols for /lib/libnss_files.so.2
> Reading symbols from /lib/libnss_nisplus.so.2...done.
> Loaded symbols for /lib/libnss_nisplus.so.2
> Reading symbols from /lib/libnsl.so.1...done.
> Loaded symbols for /lib/libnsl.so.1
> Reading symbols from /lib/libnss_nis.so.2...done.
> Loaded symbols for /lib/libnss_nis.so.2
> Reading symbols from /lib/libnss_dns.so.2...done.
> Loaded symbols for /lib/libnss_dns.so.2
> Reading symbols from /lib/libresolv.so.2...done.
> Loaded symbols for /lib/libresolv.so.2
> #0  0x8068b4c in generate_warmap (pcity=0x0, punit=0x81b9a50) at
> gotohand.c:389
> 389       if (warmap.warunit == punit && !warmap.cost[punit->x][punit->y])
> (gdb) backtrace
> #0  0x8068b4c in generate_warmap (pcity=0x0, punit=0x81b9a50) at
> gotohand.c:389
> #1  0x80ac9f3 in find_something_to_kill (pplayer=0x8123224,
> punit=0x81b9a50, x=0xbffffa44, y=0xbffffa48) at aiunit.c:1306
> #2  0x80ad913 in ai_military_attack (pplayer=0x8123224, punit=0x81b9a50)
>     at aiunit.c:1564
> #3  0x80ae1ba in ai_manage_military (pplayer=0x8123224, punit=0x81b9a50)
>     at aiunit.c:1839
> #4  0x80ae63a in ai_manage_units (pplayer=0x8123224) at aiunit.c:2003
> #5  0x804ceb3 in ai_start_turn () at srv_main.c:680
> #6  0x804c83c in srv_main () at srv_main.c:427
> #7  0x8049b15 in main (argc=8, argv=0xbffffbc4) at civserver.c:147
> #8  0x40046f31 in __libc_start_main (main=0x80495fc <main>, argc=8,
>     ubp_av=0xbffffbc4, init=0x8049014 <_init>, fini=0x80af61c <_fini>,
>     rtld_fini=0x4000e274 <_dl_fini>, stack_end=0xbffffbbc)
>     at ../sysdeps/generic/libc-start.c:129
> (gdb) print punit->x
> $1 = 80
> (gdb) print punit->y
> $2 = 11
> (gdb) print map.xsize
> $3 = 80
> (gdb)

Obviously it is the out of bounds x pos that is causing the crash.

Heh - this one has an easy, but not very informative, fix. Just add a 
normalize_map_pos() to move_unit(). Since move_unit() is the only function 
that ever sets the position of a unit it should make everything perfectly 
safe.

*Thue goes patching*

-Thue



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