delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/07/31/14:01:17

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:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-id:content-transfer-encoding
:mime-version; q=dns; s=default; b=oTQ47bz5Cw1YGgGZ0RJvzQejN4Y6d
HutimBFHqw+gQ75YLOSSCZFSB+O5DsdS+5hEqDbRRX2aoS8GxVzywUHEnLb08fHd
uGX03wO8ojIQJmqoKVQ2vzxmsyNZLOlkKiz+pQw7BFeQEphW6Ix+dwkpAmtetv0y
KqOy0rl+vejT18=
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:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-id:content-transfer-encoding
:mime-version; s=default; bh=1pxR19L6Z/YRiKYsXsJ0sEi2dCI=; b=PZM
1kU3omY/LA4d04pT6MEoGP0y63fBCLQ4tmkTbSAXrDVIJI2zr9KPd4gNG+cs9sgj
BgOWt784tymOzb2mVtK0Kg8egjDpmp6FDdka60oI6esnW2Qh99YkxZLuK+NpcN4W
BS+0AVyzYFnm7dRnS02dRfWiwAgc4gnxWaO0Uo9E=
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-Spam-SWARE-Status: No, score=-9.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=observations, downloaded, application's, evidence
X-HELO: NAM01-SN1-obe.outbound.protection.outlook.com
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kc8YEKVo6ZDHP0fhG0jA9vEVFhFwmt4v3i/Vlub2PACrBhBqxpgnudTN77jmymIJK8ZuSJHgQGO1ShS5PbAYx3hFEhBDw3JXk+J9nWtha9V7ipJEu4k9ZWaG54gzG44mXQykaXWzUsD0tdzQSrkrp6CI4I5Anky4A0eorDaHyyVK3e/Hom0t+TRRjKB0wuTOumwwLVu8xIH9xS8KxgAeR1541Cmh8IKQhPwcPvHHKiuWJqJkjKXRujveB4qTYx0xWjwVQclguHJ4ZL6kVHd8Pu3CayHSkWOMHfD0ovJyBl0tzufDH4BzqlKf+B0CzgiiVE9IribmigPOxSC2oUPURQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WQ+rk05JlDhO2EBb4Si28FmhxcUr2Qdiw84KTpOEm5o=; b=J3IXsQ2xytF93L3/YU+zUkKnDl/4c6wfYYsz7nbU7HTXuB3iS4zjiINf5ywMCx5WXr5c+GBYoIcYBiTqrdhS9fiVbaWWiCPL1Hs5RPLyC295Y7PWWO2go5OaZk8cFLSk0JSo7jW3jEnudFd2S242GxcXfy/D0XDLYahzpXRs9MHFVjpE1jHe+AXbDwpAjm0NdOg9mRHEAv0hVL5sdGVvjoali7/yHAKVBxK+TjVV91/QD9gKiKXJDlEPizAXoy69E56JLS6zoIsiYS0m+ftYH4ZpWCa8YXteHJIx/6K9u646pEg87c6UGffJZ4BaAoYU22d3HmD8QZCCSk7PHTtOew==
ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=cornell.edu;dmarc=pass action=none header.from=cornell.edu;dkim=pass header.d=cornell.edu;arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WQ+rk05JlDhO2EBb4Si28FmhxcUr2Qdiw84KTpOEm5o=; b=gOc+uXfJzGoYjx5VOIflhq8PxhjdNY3Hd21nYyMlx0ROzruwZp1gDSpFFj3jmGTMg6NOwkjKN4KTUVyHdtvpOOhBX4pQROCrXBsV7gHLUWqwaHhz3/F4fAPmcEcrT0r3LuffvanWt/nszD8dmPNkgVNhP3CI/EMRUzaQ486VmDc=
From: Ken Brown <kbrown AT cornell DOT edu>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Re: Regression (last snapshot)
Date: Wed, 31 Jul 2019 18:00:01 +0000
Message-ID: <0a09679b-1a0f-613b-04c8-1a63da8a00c2@cornell.edu>
References: <20190722164509 DOT GG21169 AT calimero DOT vinschen DOT de> <eb8007691b20df0eb8032ca3d2fa445f AT smtp-cloud8 DOT xs4all DOT net> <b3b04db5-7f03-8281-f376-6cd10207ec01 AT cornell DOT edu> <4b59209a91e8384ec000e2724696791c AT smtp-cloud7 DOT xs4all DOT net> <935d8ce5-fd5c-3010-4664-bb2dc9b7ca2f AT cornell DOT edu> <20190729084552 DOT GL11632 AT calimero DOT vinschen DOT de> <eea273ca-f190-c91a-7892-9407bfcf4326 AT cornell DOT edu> <20190729134700 DOT GO11632 AT calimero DOT vinschen DOT de> <ced2750a-0a52-1396-b6c1-f4228116bde7 AT cornell DOT edu> <20190729152327 DOT GQ11632 AT calimero DOT vinschen DOT de> <20190729154049 DOT GR11632 AT calimero DOT vinschen DOT de> <c5d01965-80b9-cece-54d2-f7462f84c0a2 AT cornell DOT edu> <8e57d4da-722d-1b9a-bd28-5f96ed182f6a AT cornell DOT edu>
In-Reply-To: <8e57d4da-722d-1b9a-bd28-5f96ed182f6a@cornell.edu>
user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0
authentication-results: spf=none (sender IP is ) smtp.mailfrom=kbrown AT cornell DOT edu;
x-ms-oob-tlc-oobclassifiers: OLM:8273;
received-spf: None (protection.outlook.com: cornell.edu does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: ksb2 AT cornell DOT edu
X-IsSubscribed: yes
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id x6VI0xDE007598

On 7/31/2019 11:53 AM, Ken Brown wrote:
> On 7/29/2019 2:55 PM, Ken Brown wrote:
>> Here's the error that I can reproduce easily in xterm:
>>
>> $ ls <(grep bash .bashrc)
>> /dev/fd/63
>> grep: write error: Broken pipe
>>
>> This happens 98% of the time.  Notice that I used plain 'ls' rather than the
>> original 'ls -lL'.  With the latter, I get the broken pipe error 60% of the time
>> rather than 98%:
>>
>> $ ls -lL <(grep bash .bashrc)
>> pr-------- 1 kbrown None 0 2019-07-29 14:46 /dev/fd/63
>> grep: write error: Broken pipe
>>
>> What about the explanation I tried earlier, but perhaps not clearly: ls prints
>> /dev/fd/63 and then exits, thereby closing the read end of the pipe, while grep
>> (running asynchronously) hasn't finished writing to the write end of the pipe.
>>
>> The fact that I get the broken pipe error more often with plain 'ls' than with
>> 'ls -lL' is consistent with that.  And the fact that I get no errors with 'cat
>> <(grep bash .bashrc)' is also consistent with it, since cat doesn't exit until
>> grep has finished writing.
>>
>> On the other hand, this doesn't explain why I see the error only under xterm,
>> nor does it explain why you can't reproduce it at all.
> 
> I've made some progress.  It turns out that the problem only occurs in terminals
> launched from the xwin-xdg-menu tray icon.  I can even launch a mintty window
> from that icon (System Tools -> Cygwin Terminal) and I'll see the problem.  On
> the other hand, I can launch an xterm without using that icon (e.g., 'DISPLAY=:0
> xterm -l&' from a mintty window) and I won't see the problem.
> 
> So the issue has something to do with how xwin-xdg-menu launches applications,
> and how that interacts with bash's process substitution.  I've just downloaded
> the xwin-xdg-menu source and will see if I can figure out what's going on.  I've
> also added Jon to the CC in case he has a chance to take a look.

OK, when xwin-xdg-menu launches an application, it creates two pipes and sets 
the application's stdout and stderr to the write ends of those pipes.  For 
example, here's what I see when I launch mintty from xwin-xdg-menu:

$ pgrep mintty
5375

$ ls -l /proc/5375/fd
total 0
lrwxrwxrwx 1 kbrown None 0 2019-07-31 13:37 0 -> /dev/null
lrwxrwxrwx 1 kbrown None 0 2019-07-31 13:37 1 -> pipe:[38654736160]
lrwxrwxrwx 1 kbrown None 0 2019-07-31 13:37 2 -> pipe:[42949703456]
lrwxrwxrwx 1 kbrown None 0 2019-07-31 13:37 3 -> /dev/ptmx
lrwxrwxrwx 1 kbrown None 0 2019-07-31 13:37 4 -> /dev/windows

These pipes are apparently used for logging.

I don't see how this would explain my observations (grep reporting a broken 
pipe), but it is at least a difference between a terminal started from 
xwin-xdg-menu and an "ordinary" terminal.

Anyway, I don't see any evidence here of a Cygwin bug.

Ken

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