Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2003:
[Freeciv-Dev] Re: Crash: Backtrace + bug.sav.gz (GTK1/FreeBSD4.7)
Home

[Freeciv-Dev] Re: Crash: Backtrace + bug.sav.gz (GTK1/FreeBSD4.7)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Guy Harrison <swampdog@xxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Crash: Backtrace + bug.sav.gz (GTK1/FreeBSD4.7)
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Thu, 20 Feb 2003 10:56:00 +0100

On Thu, Feb 20, 2003 at 07:50:10AM +0000, Guy Harrison wrote:
> 
> CVS updated a few hours ago. May be related to PR2709. Easy to trigger: move 
> Warrior at (78,8) east one square...
> 
> assertion "is_normal_map_pos(((x - 1)),( ( y - 1)))" failed: file 
> "../../freeciv/client/mapview_common.c", line 65
> 
> 65:     square_iterate(x - 1, y - 1, 1, city_x, city_y) {
> 
> Program received signal SIGABRT, Aborted.

> 0x285facc0 in kill () from /usr/lib/libc_r.so.4

Wow a libc4 system. These are rare these days.

> #3  0x806df09 in refresh_tile_mapcanvas (x=0, y=8, write_to_screen=1)
>     at ../../freeciv/client/mapview_common.c:65

> <note>
> ddd "display arguments"...
> void refresh_tile_mapcanvas(int x, int y, bool write_to_screen)
> x=0   <- trigger is zero?
> y=4
> write_to_screen=1
> 

> I got the above from a subsequent run, hence y=4 rather than y=8 as
> in the backtrace. I've verified the saved game will reliably
> crash. Dunno if it's being next to the sea or walking into
> unexplored area, or coincidence.

For the crash you need iso mode. But even with this I can't reproduce
but I can see from the code why is crashes. You are right that x==0
triggered it. The problem is that

        square_iterate(x - 1, y - 1, 1, city_x, city_y) {
                       ^^^^^^^^^^^^
          if ((pcity = map_get_city(city_x, city_y))) {
            get_canvas_xy(city_x, city_y, &canvas_x, &canvas_y);
            show_city_desc(pcity, canvas_x, canvas_y);
          }
        } square_iterate_end;

will create unreal map positions and square_iterate wants real
ones. The code has to normalize the map position before it is passed
to square_iterate.

Jason: I expect that you see this as a prove that we should remove the
check from square_iterate.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  Living on earth may be expensive, but it includes an annual free trip
  around the sun.



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