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
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.
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.
Activity
mqudsi commentedon Mar 4, 2018
Just tested, WSL only.
[-]Background jobs broken in master[/-][+]Background jobs broken in master under WSL[/+]mqudsi commentedon Mar 4, 2018
git bisect traced it back to my own commit, be13ac3 😱.
Looking into it now.
mqudsi commentedon Mar 5, 2018
Turns out some of the cleanup I removed to fix #4715, in particular, to remove needless calls to
setpgidon a spawned child process becauseposix_spawnwill set it itself exposed another WSL bug. Ugh.microsoft/WSL#2997
Add temporary fix for #4778 (background processes on WSL)
Iron out situation with setpgid() calls after posix_spawn()
mqudsi commentedon May 17, 2018
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 tosetpgid()actually goes through...Ideally, we would dump
posix_spawn()and just usevfork()directly to get guaranteed atomicity semantics here.Silence EACCES errors upon setpgid after posix_spawn()