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