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
Attempting to start my upgraded installation of fish shell via bash.exe (bash -c fish) causes bash.exe to hang indefinitely. I have attached a full dump of bash.exe in this state: bash.zip
This is on Windows 10 build 15014.
Launching bash then executing fish works just fine. Launching any other shell via bash -c ... (e.g. sh) also works just fine.
This did not use to happen until I updated my fish installation.
mqudsi@ZBook /m/c/U/Mahmoud> fish --version
fish, version 2.4.0-472-gf48291b
I can't reproduce this on [Version 10.0.15026]. Are there any other steps specific to your configuration?
This is what I did:
sudo apt install fish
bash.exe -c fish
C:\Users\benhill>bash.exe -c fish
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
benhill@BENHILL-X1 /m/c/U/benhill>
Yes, fish worked fine when installed that way for me too. However, when I manually compiled it from git to run the latest version, I ran into the problem described above.
Here's the gist for version 2.4.0-477-g44cfe3e, tail end below. It only hangs when run from bash -c. Runs fine if launched from bash inside WSL. Code in question seems to be here. I bisected a little, but just to make life difficult that tcsetpgrp() appears to be in 2.2.0 (which works fine) as well.
Note this exited below because of ctrl-c, otherwise it just hangs forever.
Might not be related, but after I upgraded to fish, version 2.6.0 it started hanging when launched. The difference is that I added fish to my .bashrc. If i started it manually, everything was fine.
I managed to solve it by just creating an empty fish.config file: # touch ~/.config/fish/config.fish
This might be a completely different issue, but was the only thing a quick google search could find :)
Reacted by Steven C. Buttgereit, Gabriel Southern and Игорь Фролов
Just an update: the latest fish compiled from git does not exhibit this problem; but not because the issue went away. Bisecting the changes between g44cfe3e and b88cacf03eb5717cf2ecaaa6ab4632bc7f7632d5 and comparing that to the previous bisect logs for when the problem was introduced (aside from being a nightmare) should be enlightening.
OK, so it's not something in the fish source code. I updated to the latest fish code and rebuilt and installed only for it to begin hanging once more. I decided to git bisect the problem, except reverting to the commit I noted in my previous build as working did not work this time around.
I'm having a hard time figuring this one out since running with full debug logging doesn't reveal anything interesting. The diff between the successful start and the failed start is also not very interesting.
Trying to debug with gdb causes the hung fish process to crash on attach, before gdb gets a chance to hook in and results in no stack trace. Launching fish under gdb hangs both gdb and fish when launched and neither responds to SIGINT .
I thought it might have something to do with the compiler; last time around I compiled with g++ but I'm not sure which version, while this time was with clang++ 4.0; so I tried to rebuild with g++ 7, but that wasn't it.
debug(0, L"calling tcsetpgrp for fd %d for pgid %d\n", STDIN_FILENO, shell_pgid);
if (tcsetpgrp(STDIN_FILENO, shell_pgid) == -1) {
debug(0, L"tcsetpgrp failed\n");
if (errno == ENOTTY) redirect_tty_output();
debug(0, _(L"Couldn't grab control of terminal"));
wperror(L"tcsetpgrp");
exit_without_destructors(1);
}
debug(0, L"tcsetpgrp ok\n");
This hangs after printing "calling tcsetpgrp ...", like reported by therealkenc above.
This same code worked the last time I compiled the same code.. and now it doesn't. It wasn't that fish worked and now it doesn't, it's it worked until I recompiled and reinstalled the same code and now it doesn't.
I'm obviously not suggesting a gremlin or anything of that nature; I imagine it has something to do with the loaded state or something that is reset on install, a conflict between bash and fish, etc.
Brian marked this as fixed in October 2017. Taking his word that something was fixed related to the OP at that time. I just tried wsl.exe /usr/bin/fish -c ls and it appears to work. This was on 17672 and Ubuntu 18.04 (fish 2.7.1).
Activity
benhillis commentedon Feb 1, 2017
I can't reproduce this on [Version 10.0.15026]. Are there any other steps specific to your configuration?
This is what I did:
mqudsi commentedon Feb 1, 2017
Yes, fish worked fine when installed that way for me too. However, when I manually compiled it from git to run the latest version, I ran into the problem described above.
Since I think bash on Windows is ABI stable, I've attached a copy of my own fish binary here. Otherwise, you can build it yourself from https://github.com/fish-shell/fish-shell
fish.gz
[-]`bash -c` hanging indefinitely[/-][+]`bash -c fish` hanging indefinitely[/+]therealkenc commentedon Feb 2, 2017
Here's the gist for version
2.4.0-477-g44cfe3e, tail end below. It only hangs when run frombash -c. Runs fine if launched from bash inside WSL. Code in question seems to be here. I bisected a little, but just to make life difficult thattcsetpgrp()appears to be in 2.2.0 (which works fine) as well.Note this exited below because of ctrl-c, otherwise it just hangs forever.
vb4life commentedon Jun 7, 2017
Might not be related, but after I upgraded to
fish, version 2.6.0it started hanging when launched. The difference is that I added fish to my.bashrc. If i started it manually, everything was fine.I managed to solve it by just creating an empty fish.config file:
# touch ~/.config/fish/config.fishThis might be a completely different issue, but was the only thing a quick google search could find :)
mqudsi commentedon Jul 9, 2017
Ben Hillis (@benhillis) any chance of an update on this? Do you think it's related to the other
fishissues?mqudsi commentedon Jul 12, 2017
Just an update: the latest
fishcompiled from git does not exhibit this problem; but not because the issue went away. Bisecting the changes betweeng44cfe3eandb88cacf03eb5717cf2ecaaa6ab4632bc7f7632d5and comparing that to the previous bisect logs for when the problem was introduced (aside from being a nightmare) should be enlightening.therealkenc commentedon Jul 12, 2017
Curious. Nothing obvious changed in fish with respect to the relevant code recently.
Interestingly
fishdoes have a test for WSL here. But it's unrelated AFAICT. I could be missing something on both counts, of course.mqudsi commentedon Aug 20, 2017
OK, so it's not something in the fish source code. I updated to the latest fish code and rebuilt and installed only for it to begin hanging once more. I decided to
git bisectthe problem, except reverting to the commit I noted in my previous build as working did not work this time around.I'm having a hard time figuring this one out since running with full debug logging doesn't reveal anything interesting. The diff between the successful start and the failed start is also not very interesting.
Trying to debug with
gdbcauses the hungfishprocess to crash on attach, beforegdbgets a chance to hook in and results in no stack trace. Launching fish under gdb hangs both gdb and fish when launched and neither responds toSIGINT.I thought it might have something to do with the compiler; last time around I compiled with g++ but I'm not sure which version, while this time was with clang++ 4.0; so I tried to rebuild with g++ 7, but that wasn't it.
mqudsi commentedon Aug 20, 2017
I tracked it down to the following code:
This hangs after printing "calling tcsetpgrp ...", like reported by therealkenc above.
This same code worked the last time I compiled the same code.. and now it doesn't. It wasn't that
fishworked and now it doesn't, it's it worked until I recompiled and reinstalled the same code and now it doesn't.I'm obviously not suggesting a gremlin or anything of that nature; I imagine it has something to do with the loaded state or something that is reset on install, a conflict between bash and fish, etc.
No longer put fish in own process group on startup
lepinekong commentedon Mar 5, 2018
I confirm that it freezes.
mathewhany commentedon Apr 2, 2018
I don't know if this could help anyone, but I managed to workaround this problem, I'm using Hyper as a terminal, and what I did is:
.bashrc, I added at the end:.hyper.js, I edited it like this:Michael137 commentedon Apr 22, 2018
Interestingely, it hangs when I simply start ubuntu.exe, but doesn't hang when i start wsl.exe first followed by ubuntu.exe
therealkenc commentedon May 24, 2018
Brian marked this as fixed in October 2017. Taking his word that something was fixed related to the OP at that time. I just tried
wsl.exe /usr/bin/fish -c lsand it appears to work. This was on 17672 and Ubuntu 18.04 (fish 2.7.1).Partially revert 55b3c45 to create pgrp when launched with invalid pgrp
Partially revert 55b3c45 to create pgrp when launched with invalid pgrp
Partially revert 55b3c45 to create pgrp when launched with invalid pgrp