Skip to content

WSL "Could not send process" bug when redirecting and piping  #4235

Closed

Description

@mqudsi

fish, version 2.6.0-208-gc577d01, similar to #3454 and possibly related to the issues in #3952

I'm able to reproduce this issue almost every time under the latest final release of Windows 10 (15063.483), filed as an issue with the WSL team here: microsoft/WSL#1210

It seems that there is a race condition in fish somewhere when both piping and redirecting, but I'm unable to reproduce this issue when fish is running under strace.

Here's an example command that always fails:

mqudsi@ZBook /m/c/U/M/g/static-compress> cat src/structs.rs  | less 2>/dev/null
Could not send process <340W, '>less ' in job f1i, 'scat src/structs.rs  | less 2>/dev/nullh' from group :278  to group C339o
usetpgid: Operation not permitted
ldCould not send job  1n ('ocat src/structs.rs  | less 2>/dev/nullt') to foreground
stcsetpgrp: Operation not permitted
end job 1 ('cat src/structs.rs  | less 2>/dev/null') to foreground
tcsetpgrp: Operation not permitted
Missing filename ("less --help" for help)
mqudsi@ZBook /m/c/U/M/g/static-compress>

If you look carefully, you can see the text is being interlaced with itself, indicating a synchronization issue. But that may just be a separate bug where fish errors are not synchronized to the console output alongside the regular console output.

I've been using fish under WSL for over a year, and have experienced this from the start across many versions of Windows 10/WSL and fish. I've never experienced similar errors under bash, fwiw.

Attempting to debug this by running strace -f -o fish.log fish -c "cat src/structs.rs | less 2>/dev/null" results in no issues whatsoever, so I'm not able to pin down what's happening. I'll probably try my hand at debugging this by adding a bunch of debug prints to the source, but I'm wondering if anyone has any ideas.

Thanks.

EDIT

I should add that the console hangs thereafter and the terminal window must be forcefully exited.

Activity

  1. mqudsi commented on Jul 25, 2017

    @mqudsi
    ContributorAuthor

    If the file being catd is larger, this error does not happen. More indication that it is a race condition.

    (e.g. this issue is not triggered by cat /usr/share/dict/words | less 2>/dev/null)

  2. mqudsi commented on Jul 25, 2017

    @mqudsi
    ContributorAuthor

    When this error is experienced: set_child_group is being called for the second command in the chain, the first command has already exited. Attempting to add the second command to the first commands process group (which doesn't exist at that point) then fails.

  3. krader1961 commented on Aug 6, 2017

    @krader1961
    Contributor

    PR#4268 that should fix this has been merged.

  4. ridiculousfish commented on Dec 24, 2017

    @ridiculousfish
    Member

    I'm hoping to get this addressed in WSL, filed microsoft/WSL#2786 with a reduced test case.

  5. locked as resolved and limited conversation to collaborators on Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugwindows subsystem for linux

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions