Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 25 Jan 2002 17:10:21 +0100 From: Corinna Vinschen To: "Pierre A. Humblet" Cc: cygwin Subject: Re: socket/fdopen/exec problem Message-ID: <20020125171021.X11608@cygbert.vinschen.de> Mail-Followup-To: "Pierre A. Humblet" , cygwin References: <3C50520B DOT 3239FAC5 AT ieee DOT org> <20020124220339 DOT K11608 AT cygbert DOT vinschen DOT de> <3C5080F8 DOT 4E4B8945 AT ieee DOT org> <20020125105955 DOT P11608 AT cygbert DOT vinschen DOT de> <3C517C32 DOT BB66DB47 AT ieee DOT org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3C517C32.BB66DB47@ieee.org> User-Agent: Mutt/1.3.22.1i On Fri, Jan 25, 2002 at 10:39:30AM -0500, Pierre A. Humblet wrote: > Consider the following > > /> netstat -a | fgrep 999 <=== daemon is running > TCP PHumblet:999 0.0.0.0:0 LISTENING > /> kill -HUP 293 <==== re-exec > /> netstat -a | fgrep 999 <==== only one listen. OK > TCP PHumblet:999 0.0.0.0:0 LISTENING > /> telnet localhost 999 > Trying 127.0.0.1... > Connected to PHumblet > Escape character is '^]'. > Hello world <=== OK, daemon is answering > and forking a worker > telnet> quit > Connection closed. > /> netstat -a | fgrep 999 > The following is fine. The daemon is listening and the previous > telnet connection is being closed. > TCP PHumblet:999 0.0.0.0:0 LISTENING > TCP PHumblet:999 localhost:2678 CLOSE_WAIT > TCP PHumblet:2678 localhost:999 FIN_WAIT_2 > /> kill -HUP 293 <=== HUP the daemon, which reexecs itself > /> netstat -a | fgrep 999 > TCP PHumblet:999 0.0.0.0:0 LISTENING > TCP PHumblet:999 0.0.0.0:0 LISTENING > TCP PHumblet:999 localhost:2678 CLOSE_WAIT > TCP PHumblet:2678 localhost:999 FIN_WAIT_2 > This is strange. There are now listeners. The only difference with > the first kill -HUP above is that a child process (forked by the > telnet call) is currently running. > /> telnet localhost 999 > Trying 127.0.0.1... > Connected to PHumblet > Escape character is '^]'. <= nobody answered > Connection closed by foreign host. <= got this much later, when child exited > > This is bad. The incoming call was not answered (no Hello world). > > The connection was closed when the child process terminated > and the second listen went away at the same time. > So the child is interfering with the listen of the parent. > > After the child exits, things go back to normal. With exim > on Win98, netstat shows that the several listeners stay forever > and incoming calls are never answered... > > Any thoughts? Not immediately. Two questions: - Did you encounter the same on NT? - Could you patch Cygwin fhandler_socket.cc, fhandler_socket::close() and rip out the whole linger stuff so that only the naked closesocket() call remains and see if that changes the behaviour? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/