Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2000:
[Freeciv-Dev] client core when server quit (PR#485)
Home

[Freeciv-Dev] client core when server quit (PR#485)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] client core when server quit (PR#485)
From: Jeff Mallatt <jjm@xxxxxxxxxxxx>
Date: Sun, 30 Jul 2000 07:53:30 -0700 (PDT)

Full_Name: Jeff Mallatt
Version: Latest CVS
Distribution: Built from source
Client: Both (or N/A)
OS: Linux (Red Hat 5.0)

I had a client connected to an AI player in an all-AI game.  While the game
was running, I quit the server.  This caused the client to core.  A quick
look showed:

#0  0x8073436 in send_connection_data (pc=0x80d61f8, data=0xbfffe1b8 "",
len=10) at connection.c:223
223         if(pc->send_buffer->do_buffer_sends) {
(gdb) l
218       write data to socket
219
**************************************************************************/
220     int send_connection_data(struct connection *pc, unsigned char
*data, int len)
221     {
222       if(pc) {
223         if(pc->send_buffer->do_buffer_sends) {
224           if (!add_connection_data(pc, data, len)) {
225             flush_connection_send_buffer(pc);
226             if (!add_connection_data(pc, data, len)) {
227               freelog(LOG_DEBUG, "send buffer filled, packet discarded");
(gdb) p pc->send_buffer
$1 = (struct socket_packet_buffer *) 0x0

Maybe, just change the 'if(pc)' to 'if(pc && pc->send_buffer)'?

However, in connection.c there seems to be many places where a non-NULL pc
is assumed to imply a non-NULL pc->send_buffer.  The real bug may be
something like a race condition between a disconnect and sending some
latent data.

jjm





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