Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: Consistent core dumps from CVS's civserver
Home

[Freeciv-Dev] Re: Consistent core dumps from CVS's civserver

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Pieter J. Kersten" <kersten@xxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Consistent core dumps from CVS's civserver
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Nov 2001 16:46:21 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Nov 13, 2001 at 03:47:14PM +0100, Pieter J. Kersten wrote:
> On Tue, 13 Nov 2001, Raimar Falke wrote:
> 
> > On Tue, Nov 13, 2001 at 09:29:08AM +0100, Pieter J. Kersten wrote:
> > > Hi Raimar,
> > >
> > > On Mon, 12 Nov 2001, Raimar Falke wrote:
> > >
> > > > On Mon, Nov 12, 2001 at 01:43:59PM +0100, Pieter J. Kersten wrote:
> > > > > L.S.,
> > > > >
> > > > > The latest CVS civserver no longer runs. After a start, it 
> > > > > consistently
> > > > > core dumps with the message:
> > > > >
> > > > > civserver: map.c:1166: map_get_continent: Assertion \
> > > > > `is_normal_map_pos(((x)),((y)))' failed
> > > > >
> > > > > Can someone correct this please?
> > > >
> > > > Can you please give a backtrace or a savegame?
> > > >
> > >
> > > Ok, here is the backtrace:
> > >
> > > #0  0x400f08d1 in __kill () from /lib/libc.so.6
> > > #1  0x400f064d in raise (sig=6) at ../sysdeps/posix/raise.c:27
> > > #2  0x400f1cb8 in abort () at ../sysdeps/generic/abort.c:88
> > > #3  0x400e9d71 in __assert_fail (assertion=0x80d18c0  \
> > > "is_normal_map_pos(((x)),((y)))",
> > >     file=0x80d1559 "map.c", line=1166, function=0x80d18df \
> > > "map_get_continent")
> > >     at assert.c:74
> > > #4  0x080965a9 in map_get_continent (x=82, y=15) at map.c:1166
> > > #5  0x0806f40f in fill_island_rivers (coast=1, bucket=0x80fe95c) at \
> > > mapgen.c:1515
> > > #6  0x080700d6 in make_island (islemass=42, starters=0) at mapgen.c:1727
> > > #7  0x080709c5 in mapgenerator4 () at mapgen.c:1963
> > > #8  0x0806e71c in map_fractal_generate () at mapgen.c:1197
> > > #9  0x0804f258 in srv_main () at srv_main.c:1916
> > > #10 0x08049f89 in main (argc=3, argv=0xbffff8dc) at civserver.c:147
> > > #11 0x400de306 in __libc_start_main (main=0x8049a70 <main>, argc=3, \
> > > ubp_av=0xbffff8dc,
> > >     init=0x80493c4 <_init>, fini=0x80b6a90 <_fini>, rtld_fini=0x4000d2cc \
> > > <_dl_fini>,
> > >     stack_end=0xbffff8cc) at ../sysdeps/generic/libc-start.c:129
> >
> > From fill_island_rivers:
> >
> >     y = myrand(s - n) + n;
> >     x = myrand(e - w) + w;
> >     if (map_get_continent(x,y) == isleindex &&
> >         map_get_terrain(x,y) == T_GRASSLAND) {
> >
> > I think this is a job for a new rand_map_pos_in_rectangle method.
> >
> > void rand_map_pos_in_rectangle(int *dest_x,int *dest_y,int topleft_x,int 
> > topleft_y,int width,int height);
> >
> 
> Something like:
> 
> void rand_map_pos_in_rectangle(
>   int *dest_x,int *dest_y,int topleft_x,int topleft_y,int width,int height
>   )
> {
   for(;;) {
     *dest_x = myrand(width) + topleft_x;
     *dest_y = myrand(height) + topleft_y;
     if(normalize_map_pos(dest_x,dest_y)) { 
       break;
     }
> }

> ? Although I can't see any solution from such in function in this matter.

Can you see it now?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 Windows: Where do you want to go today?
 Linux: Where do you want to go tomorrow?
 BSD: Are you guys coming or what?


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