Skip to content

Background jobs broken in master under WSL #4778

Closed

Description

@mqudsi

I'm not sure when this happened, but:

mqudsi@ZBook ~/r/fish-shell> echo $version
2.7.1-864-g71329a2
mqudsi@ZBook ~/r/fish-shell> cat &
mqudsi@ZBook ~/r/fish-shell>
Job 1, 'cat &' has ended
mqudsi@ZBook ~/r/fish-shell> cat &
mqudsi@ZBook ~/r/fish-shell>
Job 1, 'cat &' has ended
mqudsi@ZBook ~/r/fish-shell>

versus in fish 2.7.0:

mqudsi@ZBook ~/r/fish-shell> fish2/fish
mqudsi@ZBook ~/r/fish-shell> cat &
mqudsi@ZBook ~/r/fish-shell>
Job 1, 'cat &' has stopped
mqudsi@ZBook ~/r/fish-shell> cat &
mqudsi@ZBook ~/r/fish-shell>
Job 2, 'cat &' has stopped
mqudsi@ZBook ~/r/fish-shell>

Interestingly, the tests still pass.

Activity

  1. mqudsi commented on Mar 4, 2018

    @mqudsi
    ContributorAuthor

    Just tested, WSL only.

  2. changed the title [-]Background jobs broken in master[/-] [+]Background jobs broken in master under WSL[/+] on Mar 4, 2018
  3. mqudsi commented on Mar 4, 2018

    @mqudsi
    ContributorAuthor

    git bisect traced it back to my own commit, be13ac3 😱.

    Looking into it now.

  4. mqudsi commented on Mar 5, 2018

    @mqudsi
    ContributorAuthor

    Turns out some of the cleanup I removed to fix #4715, in particular, to remove needless calls to setpgid on a spawned child process because posix_spawn will set it itself exposed another WSL bug. Ugh.

    microsoft/WSL#2997

  5. added a commit that references this issue on Mar 5, 2018
  6. added
    bug
    regression
    on Mar 7, 2018
  7. added this to the milestone on Mar 7, 2018
  8. mqudsi commented on May 17, 2018

    @mqudsi
    ContributorAuthor

    So I just closed this with 0dd2607.

    I've never stopped thinking about this from when it came up. The results reported by @zanchey in #4715 were not what I had originally expected, and the fact that I've never been able to get this not to reproduce with glibc under WSL while it only rarely happens under Linux/glibc is annoying, but the workaround should be ok. We only set the group if it's not yet set after posix_spawn(), though of course it could be set in between the time we check that and the time when our call to setpgid() actually goes through...

    Ideally, we would dump posix_spawn() and just use vfork() directly to get guaranteed atomicity semantics here.

  9. 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

No one assigned

    Labels

    bugregression

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions