Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] (PR#8585) client crash in packets code
Home

[Freeciv-Dev] (PR#8585) client crash in packets code

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8585) client crash in packets code
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 25 Apr 2004 00:02:14 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8585 >

I started a game through the conndlg, then (after nation selection) 
immediately disconnected.  I started another, and (when I pressed the 
"start" button) the client immediately crashed.

This seems to be reproducable.  But if I connect to a network game in 
between I can then go back and launch another game.


civclient: packets_gen.c:4170: send_packet_chat_msg_req: Assertion 
`pc->phs.variant' failed.

(gdb) bt
#0  0x4068e571 in kill () from /lib/libc.so.6
#1  0x40511761 in pthread_kill () from /lib/libpthread.so.0
#2  0x40511a6b in raise () from /lib/libpthread.so.0
#3  0x4068e324 in raise () from /lib/libc.so.6
#4  0x4068f838 in abort () from /lib/libc.so.6
#5  0x40687a4f in __assert_fail () from /lib/libc.so.6
#6  0x080e1222 in send_packet_chat_msg_req (pc=0x81f2b60, packet=0x0)
     at packets_gen.c:4170
#7  0x080e12c4 in dsend_packet_chat_msg_req (pc=0x0, message=0x0)
     at packets_gen.c:4188
#8  0x0806eb95 in send_chat (message=0x0) at chatline_common.c:35
#9  0x0809d1cf in response_callback (w=0x843f118, response_id=0)
     at connectdlg.c:682

In #8 it says that send_chat(NULL) is called (this should probably be 
checked for, at least with an assertion).  However in #9 you can see 
that this is very unlikely.  Valgrind doesn't report any memory 
corruption at this point (or anything else useful).  And when I make the 
attached changes (this patch should probably be applied), the new 
assertion does not trigger.  It's easy to verify that "/novice" is 
actually the parameter.

I'm at a bit of a loss.  However a bit of tracing seems to indicate that 
there is no second fork when the server is started a second time (at 
least "/set topology 5" is not called anew).  This seems quite wrong. 
However after the crash a stale civserver process is left.  So I'm back 
at a loss again.

jason

? crash
Index: client/chatline_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/chatline_common.c,v
retrieving revision 1.5
diff -u -r1.5 chatline_common.c
--- client/chatline_common.c    28 Nov 2003 17:37:19 -0000      1.5
+++ client/chatline_common.c    25 Apr 2004 06:54:40 -0000
@@ -32,6 +32,10 @@
 **************************************************************************/
 void send_chat(const char *message)
 {
+  if (!message) {
+    assert(0);
+    return;
+  }
   dsend_packet_chat_msg_req(&aconnection, message);
 }
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#8585) client crash in packets code, Jason Short <=