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=cg+y8Zc0V/shnV0dhQnZX5r3Zx9l+ tHCyqUGrIN0GiIzTpqqQndruLDzuuhT3d9WgZ5u1JRrro6xNlIU5QDyQVnodqMti MnUtKy60Rc6vsGlqVBBy8iYQjG9j8GH2upxVLB11zp+oc7//gCxnwwNtaKMTJKOt gd5L/JNTqof/tw= 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=hBaCzvJXFdsfx0wwG8R46T05KvU=; b=Aeg qFvWuv5L9oQq4Je2nvIcLi+H+4pf2G7MOLqPmUtFjJs8q6g+EC1mDvkiBPGQHdCO 6q+9peKwt7/U6WdDEW8BsLgc/Xud+2f+cSlvQCM/pTH5b9WVq6fxbXyHwtQCTYLA PWt/uBaGnRv2JpcStVxHBbdO7/+OMseZ+qzDw4X8= 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.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,NORMAL_HTTP_TO_IP,NUMERIC_HTTP_ADDR,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: NAM05-BY2-obe.outbound.protection.outlook.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HliKE1VMvLruxuUNT/oJE0J3bis9C5BYqDqxpiKNoAHYwRYJSYebwyWqphsqY8zeGXtI2R5QgNhNPD4boC+q0HfHBMR+UrVOk4iAiQP4TD8FDktilXaP7f+U0xR3V9Nezp9MaEzZeiz0LWqnM284WGNlt3NCpaSDNo7fH2GBxfcTtc8yf9Z/+khF2hufvRtn+thx4kuUBTz5OBNDqQseOLel3uVyOXqiEif5xbKQtRr4pyz4Lee8OdB7rbwJVq3JJ0rUIhuwlnaMmxsDploKpLbpdl/A0+KSo1n2ttTsWLIhirq3+skWn70WvFXCqMieeHsImkSDvBbktb/nzp0W3Q== 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=QX9wKNmLOOyw9qrQYJGN6bPs1sAjyTEsLAYarY5hdds=; b=LyCiEtaU4LYn8Mof2l/ak2s6lJDN2npDpft+79/cQ4hNgdsreWJzSCDLKVGLhNjDnTASggqKsJb+BbU3FOB3ZhjzJcRDyzHMTk7M5W2VTBGa8l03raK7MGrIHSUABv3kdsPUbitBBw9ymvPMuuI8LNg10XSDxaBnVRtFLJqQw8YOvfEfg9tbEZAod4EMUeE8evKdo/avpd7m4SRHFo7rv969h5p4ryKWtnZaxzkW3/29p0RlVhCRLs19kMVIukpzTAXQj7ky4UwBZ6ngCXNApMU/cQcjpQwlxjqWEW3X0akBScmqTqCKfUO4LFYlfXU5zR+C57DO+OPPBpuuWmwK4Q== 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=QX9wKNmLOOyw9qrQYJGN6bPs1sAjyTEsLAYarY5hdds=; b=N0KwZLq9DJ4gXdABIt130JRz0RzhPEwh3wyDH/hhpmBUCvfn7wgiccz3nsxTY9npOljuNd9nntJS7qNx6t82st42fJHAxlZ1dKFJsPv7MsnknZ2aBKUNqQZSuao+/pv43MfZVbS2VW16QEuEjdRZuhvSlLv8TDKpU8b1/E+UX1c= From: Ken Brown To: "cygwin AT cygwin DOT com" Subject: Re: Regression (last snapshot) Date: Mon, 29 Jul 2019 13:35:41 +0000 Message-ID: <0166ad54-5417-054c-b4e3-b2a97cad8ad0@cornell.edu> References: <8f6a87faa9c8130241c026889a01d763 AT xs4all DOT nl> <5414d0e1-79d9-cab7-b1bd-4761265bf8bd AT cornell DOT edu> <265a2749-95b6-38aa-a191-7913bfcc98b6 AT cornell DOT edu> <20190722152016 DOT GE21169 AT calimero DOT vinschen DOT de> <20190722155340 DOT GF21169 AT calimero DOT vinschen DOT de> <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> 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-exchange-purlcount: 1 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: <12253C1713179B4BBBA028233FED9123 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 x6TDaJvp001600 On 7/29/2019 9:18 AM, Ken Brown wrote: > On 7/29/2019 4:45 AM, Corinna Vinschen wrote: >> On Jul 27 15:24, Ken Brown wrote: >>> On 7/27/2019 6:21 AM, Houder wrote: >>>> On Fri, 26 Jul 2019 22:12:43, Ken Brown wrote: >>>> >>>>> On 7/22/2019 2:47 PM, Houder wrote: >>>> >>>>>> The specific regression as reported, has gone. >>>>>> >>>>>> 64-@@ uname -a >>>>>> CYGWIN_NT-6.1 Seven 3.1.0s(0.339/5/3) 2019-07-22 16:43 x86_64 Cygwin >>>>>> 64-@@ ls -lL <(grep bash .bashrc) >>>>>> pr-------- 1 Henri None 0 Jul 22 20:36 /dev/fd/63 >>>>> >>>> Over all the behavior has simularity w/ the error reported by David Karr: >>>> >>>> https://cygwin.com/ml/cygwin/2019-07/msg00150.html >>>> ( Piping input from subprocess loses track of temp file ) >>> >>> Thanks, I hadn't noticed that. >>> >>> The situation is more complicated than what I reported. First, it happens even >>> in cygwin-3.0.7, as David Karr's report suggests. Second, it's true that I can >>> only reproduce it under X11, but the pattern is not as regular as I thought. I >>> just ran the ls command 1000 times in an xterm window under cygwin-3.0.7, and I >>> got the "Broken pipe" error 390 times, with a varying number of consecutive >>> successful runs between the errors. >>> >>> Repeating this under the 20190722 or 20190725 snapshots gave slightly worse >>> results (close to 500 errors). Using my own unoptimized build of cygwin1.dll, >>> the error count went up to about 650. >> >> I just tried this myself and I can't reproduce the problem. 1000 runs, >> no error. > > Interesting. And you ran this under X11 in an xterm window? > >>> I tried running under gdb, but I couldn't get grep to fail. More precisely, I >>> didn't see an error message from grep. Every run looked like this: >>> >>> $ gdb bash >>> GNU gdb (GDB) (Cygwin 8.2.1-1) 8.2.1 >>> [...] >>> (gdb) r -c 'ls -lL <(grep bash .bashrc)' >>> Starting program: /usr/bin/bash -c 'ls -lL <(grep bash .bashrc)' >>> [...] >>> pr-------- 1 kbrown None 0 2019-07-27 11:07 /dev/fd/63 >>> [...] >>> [Inferior 1 (process 21712) exited normally] >>> >>> It would be better to be able to debug ls and/or grep, but I don't know how to >>> get to subprocesses in gdb. And I think I have to start with 'gdb bash' in >>> order for the process substitution to happen. >> >> Yeah, subprocess debugging is a problem in GDB. Given how this works, >> you can at least take grep out of the picture. Bash is doing all the >> lifting, so it's just bash and ls. Did you try to reproduce this under >> strace? > > Yes, but there I get an error (even under mintty) for a different reason: > > $ strace -o trace.out ls -lL <(grep bash .bashrc) > ls: cannot access '/dev/fd/63': No such file or directory > > The strace output shows a call to fhandler_process::exists on /proc/45036/fd/63; > here 45036 is the PID of 'ls'. And then I see an EBADF error. But I think > what's happening here might be that bash is parsing '<(grep bash .bashrc)' too > soon, so that '/dev/fd/63' isn't related to the 'ls' command. > > By the way, I've just tried a different experiment, in which I simplify the ls > command to 'ls <(grep bash .bashrc)'. When I run this under xterm, I get the > broken pipe error 98% of the time or more. But it's fine under mintty. I think I may have more-or-less figured out what's going on. The "broken pipe" error simply means that ls has exited before grep has finished writing. So grep is writing to a pipe that has no readers. If I replace 'ls' by 'cat', I don't get any errors. It remains a mystery to me why I was seeing the broken pipe only under X11, but I don't see any reason to think there's a problem. 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