You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In fish 2.0.0 and newer, piping find / -maxdepth 0 to any other command, e.g. head, returns an error.
Expected:
sviatoslav@7 ~> find / -maxdepth 0 | head
/
Got:
sviatoslav@7 ~> find / -maxdepth 0 | head
Could not send process 17, 'head' in job 1, 'find / -maxdepth 0 | head' from group 2 to group 16
setpgid: Operation not permitted
head: error reading ‘standard input’: Input/output error
sviatoslav@7 ~> echo > blank
sviatoslav@7 ~> cat blank | head
Could not send process 212, 'head' in job 1, 'cat blank | head' from group 2 to group 211
setpgid: Operation not permitted
head: error reading ‘standard input’: Input/output error
Ok, I couldn't reproduce the error in follow forks mode, so here's strace attached to a fish interactive session right before executing cat blank | head.
Thanks for providing the strace, but there's not much information we can get without follow forks since the error is happening in the child process. I double checked the strace and confirmed. We'll have to try and get a local repro for debugging.
~ λ> strace -o fishdump -ff fish
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
~ λ> cat mouse | sort | uniq | wc -l
0
~ λ> pstree
init─┬─bash───tmux
└─tmux───fish───strace───fish───pstree
Looks to me like a race condition. I occasionally get it to run, and always under strace.
Welcome to fish, the friendly interactive shell [6/6]Type help for instructions on how to use fish
~ λ> cat mouse | sort | uniq | wc -l
0
~ λ> cat mouse | sort | uniq | wc -l
Could not send process 59, 'sort' in job 1, 'cat mouse | sort | uniq | wc -l' from group 15 to group 58
setpgid: Operation not permitted
sort: read failed: -: Input/output error
Could not send process 60, 'uniq' in job 1, 'cat mouse | sort | uniq | wc -l' from group 15 to group 58
setpgid: Operation not permitted
uniq: error reading '-'
Could not send process 61, 'wc' in job 1, 'cat mouse | sort | uniq | wc -l' from group 15 to group 58
setpgid: Operation not permitted
wc: 'standard input': Input/output error
0
I'm pretty sure this is a WSL bug that could be worked around in fish, but the right fix would have to come from MSFT? Please correct me if I'm wrong, though!
Ben Hillis (@benhillis) so I tracked down this bug on the fish side of things and the only idiosyncrasy I could find in WSL was that sometimes immediately after a new process group is created, EPERM is returned when another tries to join this group (via tcsetpgrp) but upon retry, the operation succeeds. Could you possibly expound on the fix for this to see if it matches our experience? In the meantime, fish 3.0 pre release builds work around the issue.
Didn't mean to close this, buttons are too close together. There were some tty related bugfixes in the build I linked that I believe will have resolved this. Mahmoud Al-Qudsi (@mqudsi) - Are you still able to reproduce this issue?
Ben Hillis (@benhillis) I'm on 15063 because my pasts experience with beta builds taught me that symbols are almost never available, which made getting useful info out of BSODs impossible. So I can't comment on whether it's fixed in 16251. My commits to Fish should avoid the issue from appearing to the end user entirely in all cases if they're running an up-to-date build, but that shouldn't be taken as an issue that the tcsetpgrp matter was resolved, naturally.
Ben Hillis (@benhillis) sorry, I somehow didn't catch what you said about tty. The problem we ran into seemed to affect both foreground and background process with and without terminal input/output equally; I don't think that would take care of it. It was almost as if tcsetpgrp was querying an out-of-date snapshot of process groups instead of the latest.
Would this error (trying to use fish shell 2.7.1 + ubuntu 16.04 + fisher + fzf plugin) be related to this bug?
v/w/m/wp-content  Could not send process 23992, '__fzfcmd' in job 2, 'history | __fzfcmd +s +m --tiebreak=index --toggle-sort=ctrl-r ' from group 30993 to group 23717
setpgid: Operation not permitted
Could not send job 2 ('history | __fzfcmd +s +m --tiebreak=index --toggle-sort=ctrl-r ') to foreground
tcsetpgrp: No such process
ls
fish: Could not send job 2 (“history | __fzfcmd +s +m --tiebreak=index --toggle-sort=ctrl-r | read -l select”) to foreground
tcsetpgrp: No such process
Activity
stehufntdev commentedon Oct 17, 2016
Thanks for reporting the issue. Can you please collect a strace with follow forks of the failing command?
Perlence commentedon Oct 17, 2016
Well, as odd as it is, the command works when invoked like this:
I thought I would run
strace -f -o fish.log fish -c "find / -maxdepth 0 | head", but it works that way 🤔Perlence commentedon Oct 17, 2016
Actually, it's more general, than I thought:
Perlence commentedon Oct 17, 2016
Ok, I couldn't reproduce the error in follow forks mode, so here's strace attached to a fish interactive session right before executing
cat blank | head.stehufntdev commentedon Oct 19, 2016
Thanks for providing the strace, but there's not much information we can get without follow forks since the error is happening in the child process. I double checked the strace and confirmed. We'll have to try and get a local repro for debugging.
aandreev commentedon Oct 28, 2016
I am having a similar issue on build 14955:
aandreev commentedon Oct 28, 2016
Strangely enough, if i continue with:
it works?!?!
Perlence commentedon Oct 28, 2016
aandreev Yep, I was puzzled by this too 😄
aandreev commentedon Oct 28, 2016
Looks to me like a race condition. I occasionally get it to run, and always under strace.
aandreev commentedon Oct 28, 2016
Confirming it is a timing issue. If I load the CPU by
I am getting the cat pipe to run almost always successfully, with rare errors.
saschagehlich commentedon Nov 24, 2016
aandreev Is this something that needs to be fixed by MS or by the fish people?
mqudsi commentedon Apr 6, 2017
I'm pretty sure this is a WSL bug that could be worked around in fish, but the right fix would have to come from MSFT? Please correct me if I'm wrong, though!
gglanzani commentedon Apr 18, 2017
I'm getting hit by this pretty hard as well since the latest release. Probably WSL is now more efficient, so I hit the race condition more often :P
6 remaining items
benhillis commentedon Aug 15, 2017
I believe this was fixed in 16251. Please let me know if you're still experiencing issues.
mqudsi commentedon Aug 15, 2017
Ben Hillis (@benhillis) so I tracked down this bug on the fish side of things and the only idiosyncrasy I could find in WSL was that sometimes immediately after a new process group is created, EPERM is returned when another tries to join this group (via
tcsetpgrp) but upon retry, the operation succeeds. Could you possibly expound on the fix for this to see if it matches our experience? In the meantime, fish 3.0 pre release builds work around the issue.benhillis commentedon Aug 15, 2017
Didn't mean to close this, buttons are too close together. There were some tty related bugfixes in the build I linked that I believe will have resolved this. Mahmoud Al-Qudsi (@mqudsi) - Are you still able to reproduce this issue?
mqudsi commentedon Aug 15, 2017
Ben Hillis (@benhillis) I'm on 15063 because my pasts experience with beta builds taught me that symbols are almost never available, which made getting useful info out of BSODs impossible. So I can't comment on whether it's fixed in 16251. My commits to Fish should avoid the issue from appearing to the end user entirely in all cases if they're running an up-to-date build, but that shouldn't be taken as an issue that the
tcsetpgrpmatter was resolved, naturally.mqudsi commentedon Aug 15, 2017
Ben Hillis (@benhillis) sorry, I somehow didn't catch what you said about tty. The problem we ran into seemed to affect both foreground and background process with and without terminal input/output equally; I don't think that would take care of it. It was almost as if tcsetpgrp was querying an out-of-date snapshot of process groups instead of the latest.
arooni commentedon Mar 3, 2018
Would this error (trying to use fish shell 2.7.1 + ubuntu 16.04 + fisher + fzf plugin) be related to this bug?
v/w/m/wp-content  Could not send process 23992, '__fzfcmd' in job 2, 'history | __fzfcmd +s +m --tiebreak=index --toggle-sort=ctrl-r ' from group 30993 to group 23717
setpgid: Operation not permitted
Could not send job 2 ('history | __fzfcmd +s +m --tiebreak=index --toggle-sort=ctrl-r ') to foreground
tcsetpgrp: No such process
ls
fish: Could not send job 2 (“history | __fzfcmd +s +m --tiebreak=index --toggle-sort=ctrl-r | read -l select”) to foreground
tcsetpgrp: No such process