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

[Freeciv-Dev] Re: 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, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: client core when server quit (PR#485)
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Mon, 31 Jul 2000 11:49:35 +1000 (EST)

Jeff Mallatt <jjm@xxxxxxxxxxxx> wrote:

> 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) 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. 

Here is a patch which adds some checks.  Checking both pc->used and
pc->send_buffer _should_ be equivalent, but just in case...
(If pc->used is zero, the TCP socket has been closed at this end, 
so we shouldn't try to send anything on it.)

>  The real bug may be
> something like a race condition between a disconnect and sending some
> latent data.

Hmm, have to think about that one...

-- David

Attachment: check_sendbuffer.diff.gz
Description: GNU Zip compressed data


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