Repository navigation
Closed
Description
Following on from Gitter, I've attempted to reproduce this in a brand new environment. Seems related to virtualfish in some way?
$ fish --version
fish, version 2.7.1-764-g56a46a0b
$ uname -a
Darwin mac.local 15.6.0 Darwin Kernel Version 15.6.0: Tue Jan 9 20:12:05 PST 2018; root:xnu-3248.73.5~1/RELEASE_X86_64 x86_64 i386 MacBookPro11,3 Darwin
$ sh -c 'env HOME=$(mktemp -d) fish'
Welcome to fish, the friendly interactive shell
zx8@mac ~> pip3 install virtualfish
Requirement already satisfied: virtualfish in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: virtualenv in /usr/local/lib/python3.6/site-packages (from virtualfish)
zx8@mac ~> set -g VIRTUALFISH_VERSION 1.0.5;set -g VIRTUALFISH_PYTHON_EXEC /usr/local/opt/python3/bin/python3.6;source /usr/local/lib/python3.6/site-packages/virtualfish/virtual.fish;emit virtualfish_did_setup_plugins
zx8@mac ~> vf tmp
The directory /var/folders/_0/wrr145xs4nj6b_8lncqmp9mm0000gn/T/tmp.4I6bqcGC1r/.virtualenvs does not exist.
Would you like to create it?
Tip: To use a different directory, set the variable $VIRTUALFISH_HOME.
y/n> y
Using base prefix '/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6'
New python executable in /var/folders/_0/wrr145xs4nj6b_8lncqmp9mm0000gn/T/tmp.4I6bqcGC1r/.virtualenvs/tempenv-70f1258906e37/bin/python3.6
Also creating executable in /var/folders/_0/wrr145xs4nj6b_8lncqmp9mm0000gn/T/tmp.4I6bqcGC1r/.virtualenvs/tempenv-70f1258906e37/bin/python
Installing setuptools, pip, wheel...done.
zx8@mac ~> vf activate tempenv-70f1258906e37
setpgid: Permission denied
Removing temporary virtualenv tempenv-70f1258906e37
setpgid: Permission denied
Metadata
Metadata
Assignees
Labels
bugSomething that's not working as intended
Activity
[-]Error when changing directories: "setpgid: Permission denied"[/-][+]"setpgid: Permission denied"[/+]zanchey commentedon Feb 9, 2018
This is almost certainly due to the changes from #4676.
The problem arises from:
zanchey commentedon Feb 9, 2018
Minimal testcase:
Sending to the background is required, otherwise the non-posix_spawn pathway is used.
zanchey commentedon Feb 13, 2018
I'm getting this a whole bunch on startup on current versions as well - @ridiculousfish, any thoughts?
Refactor job control to make functions act like their names imply
mqudsi commentedon Feb 15, 2018
This is because
set_child_group()(now?) callssetpgid()unconditionally; processes executed viaposix_spawnhave their pgid set in the arguments to that call and don't need it. I fixed this in be13ac3 along with some other refactoring to hopefully make future job control work less error prone.Thanks for the simple testcase btw, made fixing this a lot easier!
mqudsi commentedon Mar 6, 2018
I can see that @zx8 is on a mac from his host prompt; was it the same for you, @zanchey ?
There's a chance this is more of a glibc bug than a WSL bug.
zanchey commentedon Mar 9, 2018
I could reproduce this on both Debian Linux and macOS.
mqudsi commentedon Mar 9, 2018
There's a discussion going on at microsoft/WSL#2997 regarding what's really happening. There's a defect in glibc < 2.24 where
posix_spawnalmost never usesvfork()in real code (explaining whyposix_spawn()was initially added to fish to boost performance on Mac in specific), which changes the synchronization semantics of theclone()call to useCLONE_VFORK.Ubuntu 16.04 LTS (which WSL uses by default) is still on GLIBC 2.23.
@zanchey can you please check the glibc version your Debian is running?
If it is indeed
>= 2.24then I should add a define based off of whetherfork()orvfork()is used to conditionally callsetpgid()only when/where needed. If not, more investigation is warranted.(Really good discussion on this topic: famzah/popen-noshell#11)
zanchey commentedon Mar 10, 2018
I can still reproduce this using glibc 2.24-11+deb9u1 and a build from 8cf476f.
mqudsi commentedon Mar 10, 2018
Thanks, David. 🤷♀️
Iron out situation with setpgid() calls after posix_spawn()
mqudsi commentedon Jun 1, 2018
Seeing this (now?) under FreeBSD 12 with fish from
master.We should be able to just silence the error message.