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:cc:subject:date:message-id:references :in-reply-to:content-type:content-id:content-transfer-encoding :mime-version; q=dns; s=default; b=MAByA7LsUaIbkOavBp6RAJpi596XC kH1fU++woLnxzVPbRtGx43q5pVVPsMhP2OfZDd4Mq8l3+WrGuSK5TQ2RjUNSUzjC T+HJravt+zR5WjzuDhmsIwHfi1kdIbBxNwjodb7mkwgBb6y4KsGRDDNQjw2QcMIX D+6CSW5SKbn3ow= 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:cc:subject:date:message-id:references :in-reply-to:content-type:content-id:content-transfer-encoding :mime-version; s=default; bh=o7MuDvcFxMVhQtu/SHi8xOw1Pso=; b=p79 nSha+k4eZwntjggI4zaAcyTKovxdsJRW2leXFh6gvoDK94Vf/jK4Bh9PIO3NlxZw qlskaoZvobrd7oJXMJkezbgzUOsq+UKkzCTVWK/NFa+rEiK4Pbvbj3IaOmTi29Du 4jlDSMsbFALcC4zy5AcyrBBLOPlc8GTocRMogVqs= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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.9 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=downloaded, DISPLAY, icon, launched X-HELO: NAM05-DM3-obe.outbound.protection.outlook.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZZrOOMp6JnjGtx9yVe9fKSce4HYvme6YeR/MjLSLhpNlCo7FozzGBXwk+A79TIyppQea1xBenCJcgEcRZR2zgAIeMFE79fWzYwCUDXNo5Li1T4TicSiq/ZFSJ8vAEdgVvNJ4/cIWr0G6qcNn+1odejLKNxgo6dtDpIKWW4qkBEAuZHIcHZEP5V2Ti0FPFnhURsIP0l1Z4i813KCkCihgDCnBVvb4eetFVUbv3akH6h6qwosPhooWro3Kgp7Mwmk39OviZP/Pl33DQrCrArW+l2Epw+oC/PBGd3d/4FqzwwXaGMfcEGiT+kQtlxoeBkbe57k1kKskciKU5zor+FsJNQ== 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=Asuq84AGu1kIGVHQ4xdYY3pT4i2TtNN3k0ggegCzfZM=; b=SMdX51wMP+oagdb4gx2LM8RgBxBaNAKA/B4P0FhqA9FrSyLqXgvpU7KYHBREnc7oVtNAzIoPrhYPLLcg/B1t9KL/QpvpE3Vrug1A03H1N1ZVi6BFNbyyxeKmGHpRxphCw3XglzAtjmllaoW92OnIpph5gHEzGMz1v10By8o1cyic9SyxSKjOJPTLjanzRNvW6o2R/lUr8q8R76mEAMXcIh1DAoBAPSFSVAJ4IqzSlqiQdFbh/0A2uPYjbzVlNOUPgmK2110/M+NwNa3sOVnHiyKO7VveTj7GditdUgspdovlBiR+HUA49LgNG5CGeaBQM7TaELc644hvKwfoPaczWg== 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=Asuq84AGu1kIGVHQ4xdYY3pT4i2TtNN3k0ggegCzfZM=; b=JbmsomNjZ4MWIWCaa8B/ah5++EFNtfOb3ZK5+t30gbasY3eQS0ADUp8esbj2PW39oXr2ZIgpQ6GwKMJhJR3nu5tSADx5uzbQoJjcah3AaayttraL14KVRbohDYMyblzRKSm4hnsv5e8AA2FUjjn9o6pLF5WIIh8v/nK0983bQzo= From: Ken Brown To: "cygwin AT cygwin DOT com" CC: Jon TURNEY Subject: Re: Regression (last snapshot) Date: Wed, 31 Jul 2019 15:53:27 +0000 Message-ID: <8e57d4da-722d-1b9a-bd28-5f96ed182f6a@cornell.edu> References: <20190722164509 DOT GG21169 AT calimero DOT vinschen DOT de> <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> <20190729134700 DOT GO11632 AT calimero DOT vinschen DOT de> <20190729152327 DOT GQ11632 AT calimero DOT vinschen DOT de> <20190729154049 DOT GR11632 AT calimero DOT vinschen DOT de> In-Reply-To: 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:9508; received-spf: None (protection.outlook.com: cornell.edu does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 Content-Type: text/plain; charset="utf-8" Content-ID: <2AA674A5647F104FB71CD53E4335CD7C AT namprd04 DOT prod DOT outlook DOT com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ksb2 AT cornell DOT edu X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id x6VFs7qN027791 On 7/29/2019 2:55 PM, Ken Brown wrote: > On 7/29/2019 11:40 AM, Corinna Vinschen wrote: >> On Jul 29 17:23, Corinna Vinschen wrote: >>> On Jul 29 14:26, Ken Brown wrote: >>>> On 7/29/2019 9:47 AM, Corinna Vinschen wrote: >>>>> On Jul 29 13:18, Ken Brown wrote: >>>>>> $ strace -o trace.out ls -lL <(grep bash .bashrc) >>>>>> ls: cannot access '/dev/fd/63': No such file or directory >>>>> >>>>> No, please run bash: >>>>> >>>>> strace -o trace.out bash -c 'ls -lL <(grep bash .bashrc)' >>>>> >>>>> Otherwise there's no process actually creating the pipe, given the <() >>>>> expression is a bash expression. >>>> >>>> Yes, of course. I should have realized this since it's exactly what I >>>> did under gdb. Anyway, the result is the same as it was under gdb: If >>>> I run the command under strace, I don't see the broken pipe error. >>>> >>>> Is it possible that debugging causes an fd to the read end of the pipe >>>> to stay open longer, thereby preventing the error? >>> >>> The fact that you observe it sporadically points to a race condition. >>> Debugging serializes stuff usually running in parallel, potentially >>> eliminating the race. >> >> Is there any chance this is a BLODA problem? > > I doubt it. I'm seeing this on two different computers, and I haven't seen any > other symptoms suggesting BLODA. > >> If /dev/fd/63 doesn't >> exist in ls, it would mean ls didn't inherit the FIFO, which sounds >> very unlikely. > > Actually I never saw an ls error saying /dev/fd/63 doesn't exist, except in my > incorrect run of strace. > > 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. 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