From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31320 invoked by alias); 29 Apr 2010 15:11:07 -0000 Received: (qmail 31308 invoked by uid 22791); 29 Apr 2010 15:11:06 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Thu, 29 Apr 2010 15:11:03 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id E852A6D42ED; Thu, 29 Apr 2010 17:11:00 +0200 (CEST) Date: Thu, 29 Apr 2010 15:19:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: select() hanging after terminal killed Message-ID: <20100429151100.GU1845@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <201004291053.o3TAr15g018361@mail.bln1.bf.nsn-intra.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201004291053.o3TAr15g018361@mail.bln1.bf.nsn-intra.net> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2010-04/txt/msg01021.txt.bz2 On Apr 29 12:53, Thomas Wolff wrote: > If a terminal gets killed, its tty/pty is not properly closed. > This is likely to confuse applications and let them hang, as observed > with mined (thanks Andy for the report) and joe. > > On Linux and SunOS, a subsequent read() return 0 (indicating EOF); > any further read() returns -1, errno indicating EIO. > Immediate write() may report success a few times, > further write() returns -1, errno indicating EIO. > > On Linux, select() indicates an exception and EIO. > On SunOS, select() indicates both an exception and input (weird), > and ENOENT initially, EIO on further attempts. > > On Cygwin, the following is observed: > * EOF is not signalled on read(); rather EIO is indicated right away. > (Maybe not too bad, an application can handle that as well.) > * select() with timeout hangs. > > Especially the latter can hardly be handled by an application. Can you create a simple testcase? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple