public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: Regression (last snapshot)
Date: Mon, 29 Jul 2019 13:18:00 -0000	[thread overview]
Message-ID: <eea273ca-f190-c91a-7892-9407bfcf4326@cornell.edu> (raw)
In-Reply-To: <20190729084552.GL11632@calimero.vinschen.de>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3463 bytes --]

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.

Ken
\0ТÒÐÐ¥\a&ö&ÆVÒ\a&W\x06÷'G3¢\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒ÷\a&ö&ÆV×2æ‡FÖÀФd\x15\x13¢\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöf\x17\x12ðФFö7VÖVçF\x17F–öã¢\x02\x02\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöFö72æ‡FÖÀÐ¥Vç7V'67&–&R\x06–æfó¢\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöÖÂò7Vç7V'67&–&R×6–×\x06ÆPРÐ

  reply	other threads:[~2019-07-29 13:18 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-20 22:55 Houder
2019-07-21  9:38 ` Houder
2019-07-21  9:42   ` Houder
2019-07-22 12:23 ` Ken Brown
2019-07-22 13:44   ` Ken Brown
2019-07-22 15:20     ` Corinna Vinschen
2019-07-22 15:53       ` Corinna Vinschen
2019-07-22 16:45         ` Corinna Vinschen
2019-07-22 18:47           ` Houder
2019-07-26 22:12             ` Ken Brown
2019-07-27  0:14               ` Ken Brown
2019-07-27 10:21               ` Houder
2019-07-27 15:24                 ` Ken Brown
2019-07-27 16:25                   ` Houder
2019-07-29  8:45                   ` Corinna Vinschen
2019-07-29 13:18                     ` Ken Brown [this message]
2019-07-29 13:35                       ` Ken Brown
2019-07-29 13:48                         ` Corinna Vinschen
2019-07-29 13:47                       ` Corinna Vinschen
2019-07-29 14:26                         ` Ken Brown
2019-07-29 15:23                           ` Corinna Vinschen
2019-07-29 15:40                             ` Corinna Vinschen
2019-07-29 18:56                               ` Ken Brown
2019-07-31 15:53                                 ` Ken Brown
2019-07-31 18:00                                   ` Ken Brown
2019-08-01  9:01                                     ` Corinna Vinschen
2019-08-01 14:27                                     ` Jon Turney
2019-08-01 15:30                                       ` Ken Brown
2019-08-01 15:38                                         ` Eric Blake
2019-08-01 16:04                                           ` Corinna Vinschen
2019-08-01 21:17                                             ` Ken Brown
2019-08-02  2:32                                               ` Ken Brown
2019-08-02 14:34                                                 ` Ken Brown
2019-08-02 15:04                                                   ` Corinna Vinschen
2019-08-02 21:26                                                   ` Brian Inglis
2019-08-02 21:53                                                     ` Ken Brown
2019-08-02 21:58                                                       ` Eric Blake
2019-08-03  3:50                                                         ` Brian Inglis
2019-08-03 13:14                                                           ` Ken Brown
2019-08-04 16:52                                                   ` Houder
2019-08-01 10:03                                   ` Houder
2019-08-01 10:46                                     ` Houder
2019-08-01 12:20                                     ` Ken Brown
2019-08-01 14:29                                       ` Houder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eea273ca-f190-c91a-7892-9407bfcf4326@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).