From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2759 invoked by alias); 29 Apr 2010 10:53:10 -0000 Received: (qmail 2748 invoked by uid 22791); 29 Apr 2010 10:53:10 -0000 X-SWARE-Spam-Status: No, hits=0.8 required=5.0 tests=BAYES_50 X-Spam-Check-By: sourceware.org Received: from ns2.sietec.de (HELO mail.sietec.de) (213.61.69.205) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Apr 2010 10:53:05 +0000 Received: from mail.bln1.bf.nsn-intra.net (ns2.bln1.bf.nsn-intra.net [10.149.159.159]) by mail.sietec.de (8.13.5/8.13.5/MTA) with ESMTP id o3TAr11S012059 for ; Thu, 29 Apr 2010 12:53:02 +0200 (MEST) Received: from scotty.bln1.bf.nsn-intra.net (stbd7124.bln1.bf.nsn-intra.net [10.149.147.77]) by mail.bln1.bf.nsn-intra.net (8.13.5/8.13.5/MTA) with SMTP id o3TAr15g018361 for cygwin@cygwin.com; Thu, 29 Apr 2010 12:53:01 +0200 (CEST) Date: Thu, 29 Apr 2010 11:28:00 -0000 Message-Id: <201004291053.o3TAr15g018361@mail.bln1.bf.nsn-intra.net> To: cygwin@cygwin.com From: Thomas Wolff Subject: select() hanging after terminal killed X-IsSubscribed: yes 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/msg01014.txt.bz2 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. ------ Thomas -- 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