delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/04/29/11:21:55

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 29 Apr 2010 11:21:42 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: select() hanging after terminal killed
Message-ID: <20100429152142.GA30282@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <201004291053 DOT o3TAr15g018361 AT mail DOT bln1 DOT bf DOT nsn-intra DOT net> <20100429151100 DOT GU1845 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20100429151100.GU1845@calimero.vinschen.de>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Thu, Apr 29, 2010 at 05:11:00PM +0200, Corinna Vinschen wrote:
>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?

Hmm.  Since the owner has both sides of the pipe open maybe closing the
slave side doesn't trigger select.

It's possible that Corinna's changes to tty handling might make this
work better.  It would be interesting to see how this works in a recent
snapshot.

cgf

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019