Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2003:
[Freeciv-Dev] (PR#4344) goto woes
Home

[Freeciv-Dev] (PR#4344) goto woes

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#4344) goto woes
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Sun, 1 Jun 2003 11:29:26 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Attached is a fix for the below crash.  Essentially it reverts and earlier 
patch and uses a more down-to-earth solution.

Will be commited soon (this crash is annoying).

G.

On Thu, 29 May 2003, Per I. Mathisen wrote:

> Whenever I press 'g' for 'goto' the client cores.
> 
> civclient: map.c:1293: same_pos: Forutsetningen (assertion)
> «is_normal_map_pos((x2),(y2))» feilet.
> 
> #0  0xffffe002 in ?? ()
> #1  0x42028b93 in abort () from /lib/tls/libc.so.6
> #2  0x42020f95 in __assert_fail () from /lib/tls/libc.so.6
> #3  0x080bac06 in same_pos (x1=35, y1=14, x2=-1, y2=-1) at map.c:1295
> #4  0x0806dac7 in reset_last_part () at goto.c:205
> #5  0x0806db94 in add_part () at goto.c:248
> #6  0x0806ddd3 in enter_goto_state (punit=0x0) at goto.c:350
> #7  0x0806bcad in request_unit_goto () at control.c:577
> #8  0x400d25f8 in gtk_item_factory_new () from
> /usr/lib/libgtk-x11-2.0.so.0
> #9  0x403b4d77 in g_cclosure_marshal_VOID__VOID ()
>    from /usr/lib/libgobject-2.0.so.0
> #10 0x403a1ed7 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
> #11 0x403b4983 in g_signal_emit_by_name () from
> /usr/lib/libgobject-2.0.so.0
> #12 0x403b39a8 in g_signal_emit_valist () from
> /usr/lib/libgobject-2.0.so.0
> #13 0x403b3be4 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
> #14 0x401d170a in gtk_widget_translate_coordinates ()
>    from /usr/lib/libgtk-x11-2.0.so.0
> #15 0x403a1ed7 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
> #16 0x403b4983 in g_signal_emit_by_name () from
> /usr/lib/libgobject-2.0.so.0
> #17 0x403b37af in g_signal_emit_valist () from
> /usr/lib/libgobject-2.0.so.0
> #18 0x403b3be4 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
> #19 0x40055b4d in _gtk_accel_group_activate ()
>    from /usr/lib/libgtk-x11-2.0.so.0
> [and so on]
> 
>   - Per
> 
> 
> 

Index: client/goto.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/goto.c,v
retrieving revision 1.50
diff -u -r1.50 goto.c
--- client/goto.c       2003/05/28 14:48:38     1.50
+++ client/goto.c       2003/06/01 18:25:56
@@ -239,13 +239,12 @@
     p->start_moves_left = prev->end_moves_left;
   }
   p->path = NULL;
-  p->end_x = -1;
-  p->end_y = -1;
+  p->end_x = p->start_x;
+  p->end_y = p->start_y;
   parameter.start_x = p->start_x;
   parameter.start_y = p->start_y;
   parameter.moves_left_initially = p->start_moves_left;
   p->map = pf_create_map(&parameter);
-  reset_last_part();
 }
 
 /********************************************************************** 
@@ -258,7 +257,10 @@
   assert(goto_map.num_parts >= 1);
 
   reset_last_part();
-  pf_destroy_path(p->path);
+  if (p->path) {
+    /* We do not always have a path */
+    pf_destroy_path(p->path);
+  }
   pf_destroy_map(p->map);
   goto_map.num_parts--;
 }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#4344) goto woes, Gregory Berkolaiko <=