delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/03/08/03:38:12

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:in-reply-to
:references:mime-version:content-type; q=dns; s=default; b=lY06e
OPjOUnSkJkAcj23PryYbSOPtfP6Zum78PJdITjSUE8Pj9NniC+Chg2n7MQJrFe9+
ZeOk0pbCGSnCwCJLn65nMj94j80OM4ENh9Ghlz+YSmU3Fh9Ix5HmJRXAmTD3VqmT
V6HjcyS//lrFJnk4LSL0/JtKsWPakOSA0Ut+YM=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:in-reply-to
:references:mime-version:content-type; s=default; bh=uXdN391Iwvt
yBdJHZKCMZyJnnYo=; b=neKqOCMJKO2Bd8hMtfEucjXFsFUDThzT2PXernijijP
YDgnol9gD1JFOxwhsC+NPPGtBg23HgvjHU/8YR7DNmG+i9wz4WZQy063ACtwtzz+
s+yyy3y7p8PiMWWn6iFqjU5Y9+4EY8dPzIhqlQgDCGgT58uO6j+L0HLflLAA/pCA
=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_SORBS_DUL,SPF_PASS autolearn=ham version=3.3.2
X-HELO: conuserg003-v.nifty.com
X-Nifty-SrcIP: [121.93.68.199]
Date: Sun, 8 Mar 2015 16:37:59 +0900
From: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
To: cygwin AT cygwin DOT com
Subject: Re: PTY dies when master in parent process is closed.
Message-Id: <20150308163759.9d3eacd5f3b168a1515a6bc2@nifty.ne.jp>
In-Reply-To: <20150306200710.1264a46aa8dd633943e56212@nifty.ne.jp>
References: <20150305215323 DOT 760df4752fdbd6f19a931851 AT nifty DOT ne DOT jp> <20150305133100 DOT GY3213 AT calimero DOT vinschen DOT de> <20150305135839 DOT GZ3213 AT calimero DOT vinschen DOT de> <20150306200710 DOT 1264a46aa8dd633943e56212 AT nifty DOT ne DOT jp>
Mime-Version: 1.0
X-IsSubscribed: yes

--Multipart=_Sun__8_Mar_2015_16_37_59_+0900_N6L9FRceyIKOw3Xo
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Fri, 6 Mar 2015 20:07:10 +0900
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp> wrote:

> On Thu, 5 Mar 2015 14:58:39 +0100
> Corinna Vinschen <corinna-cygwin AT cygwin DOT com> wrote:
> 
> > I applied a patch.  Please have a look.
> 
> I have tested the latest CVS version, and found
> a new problem.
> 
> With new CVS version, slave side can not detect
> closure of master.
> 
> Please use following Test Case 3. Test Case 3 is
> not terminated by itself with latest CVS.
> 
> It seems that the program is stopping at
> cygwait(input_available_event, time_to_wait)
> in fhandler_pty_slave::read().
> 
> I guess input_available_event should be set when
> the last valid master fd is closed.

For this problem, I have made a patch.

With this patch, it has been confirmed that the problems
in Test Case 1, 2 and 3 are fixed.

I am glad if this would be a help.

However, one matter to be concerned is irregular use of
PeekNamedPipe(). Maybe alternative means could be better
for detecting closure of all master fds.


-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>

--Multipart=_Sun__8_Mar_2015_16_37_59_+0900_N6L9FRceyIKOw3Xo
Content-Type: application/octet-stream;
 name="cygwin.patch.20150308"
Content-Disposition: attachment;
 filename="cygwin.patch.20150308"
Content-Transfer-Encoding: base64

SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBm
aWxlOiAvY3ZzL3NyYy9zcmMvd2luc3VwL2N5Z3dpbi9DaGFuZ2VMb2csdgpy
ZXRyaWV2aW5nIHJldmlzaW9uIDEuNjY3MQpkaWZmIC11IC1wIC1yMS42Njcx
IENoYW5nZUxvZwotLS0gQ2hhbmdlTG9nCTUgTWFyIDIwMTUgMTM6NTg6MDIg
LTAwMDAJMS42NjcxCisrKyBDaGFuZ2VMb2cJNyBNYXIgMjAxNSAyMjo0Njoz
NiAtMDAwMApAQCAtMSwzICsxLDggQEAKKzIwMTUtMDMtMDggIFRha2FzaGkg
WWFubyA8dGFrYXNoaS55YW5vQG5pZnR5Lm5lLmpwPgorCisJKiBmaGFuZGxl
cl90dHkuY2MgKGZoYW5kbGVyX3B0eV9tYXN0ZXI6OmNsb3NlKTogQWRkIGNv
ZGUgdG8gbWFrZSBzbGF2ZQorCWRldGVjdCBjbG9zdXJlIG9mIG1hc3Rlci4g
Rml4IHR5cG8gaW4gZXJyb3IgbWVzc2FnZS4KKwogMjAxNS0wMy0wNSAgQ29y
aW5uYSBWaW5zY2hlbiAgPGNvcmlubmFAdmluc2NoZW4uZGU+CiAKIAkqIHR0
eS5oICh0dHk6OnNldF9tYXN0ZXJfY3RsX2Nsb3NlZCk6IFJlbmFtZSBmcm9t
IHNldF9tYXN0ZXJfY2xvc2VkLgpJbmRleDogZmhhbmRsZXJfdHR5LmNjCj09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC9jdnMvc3JjL3NyYy93
aW5zdXAvY3lnd2luL2ZoYW5kbGVyX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UgKGVjaG9fdyk7CiAgIGVjaG9fciA9IGVjaG9fdyA9IE5VTEw7CiAK
LSAgZmhhbmRsZXJfcHR5X2NvbW1vbjo6Y2xvc2UgKCk7Ci0KICAgaWYgKGhh
dmVfZXhlY2VkIHx8IGdldF90dHlwICgpLT5tYXN0ZXJfcGlkICE9IG15c2Vs
Zi0+cGlkKQogICAgIHRlcm1pb3NfcHJpbnRmICgibm90IGNsZWFyaW5nOiAl
ZCwgbWFzdGVyX3BpZCAlZCIsIGhhdmVfZXhlY2VkLCBnZXRfdHR5cCAoKS0+
bWFzdGVyX3BpZCk7CiAgIGlmICghRm9yY2VDbG9zZUhhbmRsZSAoaW5wdXRf
YXZhaWxhYmxlX2V2ZW50KSkK


--Multipart=_Sun__8_Mar_2015_16_37_59_+0900_N6L9FRceyIKOw3Xo
Content-Type: text/plain; charset=us-ascii

--
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
--Multipart=_Sun__8_Mar_2015_16_37_59_+0900_N6L9FRceyIKOw3Xo--

- Raw text -


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