[Freeciv-Dev] (PR#40565) 0: nation_of_player() has NULL nation

2008-11-15 Thread Pepeto

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40565 

Every time I reload a savegame with trunk/, I cannot open the nation page:

0: nation_of_player() has NULL nation
0: Detected fatal error in nation.c line 262:
0: bad nation

#0  0x7fac62287095 in raise () from /lib/libc.so.6
No symbol table info available.
#1  0x7fac62288af0 in abort () from /lib/libc.so.6
No symbol table info available.
#2  0x7fac622802df in __assert_fail () from /lib/libc.so.6
No symbol table info available.
#3  0x00452a86 in real_die (file=value optimized out, 
line=value optimized out, format=0x50a4c4 bad nation) at
shared.c:772
ap = {{gp_offset = 24, fp_offset = 48, 
overflow_arg_area = 0x7fff6cff4d30, reg_save_area = 0x7fff6cff4c70}}
__PRETTY_FUNCTION__ = real_die
#4  0x00463664 in nation_of_player (pplayer=0x7e6ad8) at
nation.c:262
__PRETTY_FUNCTION__ = nation_of_player
#5  0x004eb580 in build_row (it=0x7fff6cff4e70, i=3) at plrdlg.c:599
plr = (struct player *) 0x7e6ad8
pixbuf = (GdkPixbuf *) 0x7e6ad8
style = value optimized out
weight = value optimized out
k = 2
__PRETTY_FUNCTION__ = build_row
#6  0x004eb731 in update_players_dialog () at plrdlg.c:710
pplayer = (struct player *) 0x7e6ad8
MY_i = 3
i = value optimized out
it = {stamp = -1743625704, user_data = 0x287e030, user_data2 = 0x0, 
  user_data3 = 0x0}
it_next = {stamp = 32, user_data = 0x10006, user_data2 = 0x20, 
  user_data3 = 0x26bec50}
#7  0x004ec42d in popup_players_dialog (raise=true) at plrdlg.c:525
No locals.
#8  0x7fac635c3bbf in g_closure_invoke () from
/usr/lib/libgobject-2.0.so.0
No symbol table info available.
#9  0x7fac635d77e8 in ?? () from /usr/lib/libgobject-2.0.so.0
No symbol table info available.
#10 0x7fac635d9245 in g_signal_emit_valist ()
   from /usr/lib/libgobject-2.0.so.0
No symbol table info available.
#11 0x7fac635d9633 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
No symbol table info available.
#12 0x7fac64a62198 in gtk_widget_activate ()
   from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#13 0x7fac64962c46 in gtk_menu_shell_activate_item ()
   from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#14 0x7fac64964636 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#15 0x7fac6495687f in ?? () from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#16 0x7fac635c3bbf in g_closure_invoke () from
/usr/lib/libgobject-2.0.so.0
No symbol table info available.
#17 0x7fac635d7bc8 in ?? () from /usr/lib/libgobject-2.0.so.0
No symbol table info available.
#18 0x7fac635d8f6f in g_signal_emit_valist ()
   from /usr/lib/libgobject-2.0.so.0
No symbol table info available.
#19 0x7fac635d9633 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
No symbol table info available.
#20 0x7fac64a5de55 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#21 0x7fac6494fb92 in gtk_propagate_event ()
   from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#22 0x7fac64950b35 in gtk_main_do_event ()
   from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#23 0x7fac645ba58c in ?? () from /usr/lib/libgdk-x11-2.0.so.0
No symbol table info available.
#24 0x7fac62f27364 in g_main_context_dispatch ()
   from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#25 0x7fac62f2a675 in ?? () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#26 0x7fac62f2a995 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#27 0x7fac64950f03 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#28 0x004d9f4a in ui_main (argc=1, argv=0x7fff6cff64c8)
at gui_main.c:1588
home = value optimized out
sig = value optimized out
style = value optimized out
#29 0x00415c51 in main (argc=value optimized out, 
argv=0x7fff6cff64c8) at civclient.c:428
i = 1
loglevel = 2
ui_options = value optimized out
ui_separator = value optimized out
option = 0x0
user_tileset = false


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40565) 0: nation_of_player() has NULL nation

2008-11-15 Thread Madeline Book

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40565 

 [pepeto - Sat Nov 15 14:08:13 2008]:
 
 Every time I reload a savegame with trunk/, I cannot open the
 nation page:
 
 0: nation_of_player() has NULL nation
 0: Detected fatal error in nation.c line 262:
 0: bad nation

Yep, confirmed. It appears that the client keeps stale
player information when a game is loaded in pregame.
Attached patch makes the server send the necessary info
in the load command so that clients do not get confused.


---
私の現実を返してくれ。
diff --git a/server/stdinhand.c b/server/stdinhand.c
index bc07265..d9d92d9 100644
--- a/server/stdinhand.c
+++ b/server/stdinhand.c
@@ -3390,10 +3390,23 @@ bool load_command(struct connection *caller, const char *filename, bool check)
 return TRUE;
   }
 
-  /* we found it, free all structures */
+  /* Detach current players, before we blow them away. */
+  conn_list_iterate(game.est_connections, pconn) {
+if (pconn-playing != NULL) {
+  detach_connection_to_player(pconn, FALSE);
+  send_conn_info(pconn-self, NULL);
+}
+  } conn_list_iterate_end;
+
+  /* Now free all game data. */
   server_game_free();
   server_game_init();
 
+  /* Tell clients that all players have been removed. */
+  player_slots_iterate(pslot) {
+send_player_slot_info_c(pslot, NULL);
+  } player_slots_iterate_end;
+
   loadtimer = new_timer_start(TIMER_CPU, TIMER_ACTIVE);
   uloadtimer = new_timer_start(TIMER_USER, TIMER_ACTIVE);
 
@@ -3414,20 +3427,20 @@ bool load_command(struct connection *caller, const char *filename, bool check)
   send_server_settings(game.est_connections);
   send_game_info(game.est_connections);
 
+  /* Send information about the new players. */
+  send_player_info_c(NULL, NULL);
+
   /* Everything seemed to load ok; spread the good news. */
   send_load_game_info(TRUE);
-
-  /* attach connections to players. currently, this applies only 
-   * to connections that have the correct username. Any attachments
-   * made before the game load are unattached. */
+  
+  /* Attach connections to players. Currently, this applies only 
+   * to connections that have the same username as a player. */
   conn_list_iterate(game.est_connections, pconn) {
-if (NULL != pconn-playing) {
-  detach_connection_to_player(pconn, FALSE);
-}
 players_iterate(pplayer) {
   if (strcmp(pconn-username, pplayer-username) == 0) {
 attach_connection_to_player(pconn, pplayer, FALSE);
-send_player_info_c(pplayer, game.est_connections);
+send_player_info_c(pplayer, NULL);
+send_conn_info(pconn-self, NULL);
 break;
   }
 } players_iterate_end;
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev