public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: select() hanging after terminal killed
Date: Thu, 29 Apr 2010 15:24:00 -0000	[thread overview]
Message-ID: <20100429152142.GA30282@ednor.casa.cgf.cx> (raw)
In-Reply-To: <20100429151100.GU1845@calimero.vinschen.de>

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

  reply	other threads:[~2010-04-29 15:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-29 11:28 Thomas Wolff
2010-04-29 12:17 ` Matthias Andree
2010-04-29 14:18   ` Thomas Wolff
2010-04-29 16:40     ` Matthias Andree
2010-04-29 15:19 ` Corinna Vinschen
2010-04-29 15:24   ` Christopher Faylor [this message]
2011-05-26 22:44 Thomas Wolff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100429152142.GA30282@ednor.casa.cgf.cx \
    --to=cgf-use-the-mailinglist-please@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).