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 18:56:00 -0000	[thread overview]
Message-ID: <c5d01965-80b9-cece-54d2-f7462f84c0a2@cornell.edu> (raw)
In-Reply-To: <20190729154049.GR11632@calimero.vinschen.de>

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.

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


  reply	other threads:[~2019-07-29 18:56 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
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 [this message]
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=c5d01965-80b9-cece-54d2-f7462f84c0a2@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).