Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git Bash Crash on Launch. Error: could not fork child process #910

Closed
hwallace90 opened this issue Oct 6, 2016 · 21 comments
Closed

Git Bash Crash on Launch. Error: could not fork child process #910

hwallace90 opened this issue Oct 6, 2016 · 21 comments

Comments

@hwallace90
Copy link

  • [x ] I was not able to find an open
    or closed issue
    matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options
git version 2.10.1.windows.1
sizeof-long: 4
machine: x86_64
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver
Microsoft Windows [Version 6.1.7601]

Windows 7
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt
Path Option: BashOnly
SSH Option: OpenSSH
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Attempting to run in Bash

When opening Git Bash I get the following error:

Error: could not fork child process: Resource temporarily unavailable (-1). DLL rebasing may be required. See 'rebaseall / rebase --help'.

When I press enter Git Bash closes. I've tried reinstalling, installing different versions, restarting, and nothing seems to help.
gitbash

@dscho
Copy link
Member

dscho commented Oct 7, 2016

Could you quickly try installing Cygwin and see whether it runs?

@hwallace90
Copy link
Author

It did not, same error. I installed Cygwin with all the defaults. At the end it did show this, which I thought was noteworthy given the issue I'm facing:
cygwin

@dscho
Copy link
Member

dscho commented Oct 7, 2016

That is what I feared. Those errors come from the MSYS2 runtime, which is itself a friendly fork of the Cygwin runtime. Meaning: whenever Cygwin updates, we update, too.

Could you try previous Git for Windows versions to see whether they demonstrate the same problem, or whether it is a regression in the newest version?

@hwallace90
Copy link
Author

I've tried several different versions, one much older (1.9.2), a few more recent, all the same error. Just to double check, I just installed 2.9.2, same error.

@dscho
Copy link
Member

dscho commented Oct 7, 2016

Hrm. Maybe you one of those applications installed? https://cygwin.com/faq/faq.html#faq.using.bloda

@hwallace90
Copy link
Author

Correct, this is a work computer at a large corporation with McAfee installed and I'm sure other firewalls and things of that nature. Other coworkers are not having the same issues I am strangely enough. I will escalate internally to see if I can get any assistance. This is my nightmare D: . Thank you for the information.

@dscho
Copy link
Member

dscho commented Oct 8, 2016

McAfee is not on the BLODA list, but maybe you can identify another "dubious" application (such as PowerBroker) that is running in your setup?

@hwallace90
Copy link
Author

Luckily for me, I come into work today and it is now working. It being a work computer, some update must have been pushed that now allows it to work. Weird experience, thank you for the information and assistance though.

@dscho
Copy link
Member

dscho commented Oct 12, 2016

@hwallace90 let's close it until the day it resurfaces?

@dscho dscho closed this as completed Nov 16, 2016
@ghost
Copy link

ghost commented Dec 21, 2016

I had exactly the same error which I managed to fix. I'm adding these details in case anyone else has the same problem. It fails on one PC but is OK on two others. The only software I have installed that is on the BLODA list is Windows Defender but I tried disabling this temporarily with no change. An uninstall and reinstall also failed to solve the problem. All PCs are running Windows 10.

I managed to finally fix it by running C:\Users\USERNAME\AppData\Local\GitHub\PortableGit_d7effa1a4a322478cd29c826b52a0c118ad3db11\post-install.bat from an elevated command prompt. It showed a couple of errors but everything seems to be working fine afterwards.

@shiftkey
Copy link

I managed to finally fix it by running C:\Users\USERNAME\AppData\Local\GitHub\PortableGit_d7effa1a4a322478cd29c826b52a0c118ad3db11\post-install.bat from an elevated command prompt.

This seems to be GitHub Desktop rather than Git for Windows. But I'm glad you were able to get to the bottom of it.

@gparsloe
Copy link

gparsloe commented Feb 7, 2017

I had the same problem and (at least temporarily) got around it by stopping two processes in the Windows Task Manager, both of which were called 'bash.exe'.

Details of how to do that: Open Windows Task Manager, go to the Processes tab, select and right click on the process you want to end and choose 'end process'.

@spiegelm
Copy link

spiegelm commented Apr 5, 2017

I had the same problem and could solve it by killing all the ssh-agent.exe processes (15+) in the task manager.

@rprastein
Copy link

rprastein commented Jun 8, 2017

I had a similar problem. My resolution was essentially the same as dpGoose, but I got a copy of post-install.bat from executing the PortableGit 7z.exe download and quickly copying post-install.bat before it got a chance to execute and delete itself. Then I edited it so that it would do its rebase on my 64-bit Git for Windows (it checks that MINGW32 folder is there, I edited it to check for MINGW64 instead). #1200

Rebeccah

@gopinaath007
Copy link

Thank you @yangshengf one of the solutions in this issue resolved my error

@gopinaath007
Copy link

#1523 resolved thanks to @yangshengf

@ghogen
Copy link

ghogen commented Sep 12, 2018

Encountered this today and solved it by killing a single instance of ssh-agent that was running.

@nngo
Copy link

nngo commented Sep 28, 2018

I have encountered this issue on my Windows 10 64-bit PC several times in the past two months. I am current running git version 2.18.0.windows.1 under Git Bash for Windows. Running tasklist | grep bash show two instances of bash.exe, one instance of git-bash.exe, and one instance of ssh-agent.exe.

On the title bar it says /usr/bin/bash --login -i and inside the terminal it says

Error: Could not fork child process: There are no available terminals (-1).

My shortcut to run Git Bash, calls git-bash.exe --cd-to-home
Running mingw64.exe, ming32.exe, or msys2.exe in the install directory has the same issue.
Running autorebase.bat from the install directory did not solve the problem.

So, after kill the two bash.exe processes, I am able to launch only one Git Bash terminal. Trying to launch a second Git Bash terminal results in the Error: Could not fork child process: There are no available terminals (-1).. I have one workaround by switching to another installation e.g. Git Bash SDK. Another workaround is to reboot my Windows machine, but after a week or so this problem returns.

@sg552
Copy link

sg552 commented Jan 3, 2019

in my case, I found this error when running a Vuejs app. (using node)

according to : https://stackoverflow.com/questions/45799650/git-bash-error-could-not-fork-child-process-there-are-no-available-terminals

I killed "node.exe" in the task manager, ( ctrl + alt + del) and it works!

@Kumar141
Copy link

Kumar141 commented Jan 3, 2021

I got the same issue and as few people have mentioned that they got away by killing bash.exe or ssh-agent.exe but in my case I coudln't find any of this in task manager, or maybe I'm too stupid to find them anyway if someone can explain these or any other solution which can solve this problem then it'd be a very big help and also i'm not a tech savy so keep it in mind.

@mhdshameel
Copy link

mhdshameel commented May 12, 2023

I am facing the same issue with git-bash in my win 11 device. I tried almost all the mentioned fixes here to no avail.

I can't find any bash.exe or ssh-agent.exe processes. I also tried running the post-install.bat and again running it with changing mingw32 to mingw64 then I get an error stating:
rebase: Invalid Baseaddress 0x64000000, must be > 0x200000000
This error statement itself is illogical as the 0x200000000 actually crosses the 64 bit address range (easy way to figure out is to count the zeros in it).
After echoing this it goes on to fork bash.exe processes and all fails.

 0 [main] bash 1382 dofork: child -1 - forked process 9844 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
usr/bin/bash: fork: retry: Resource temporarily unavailable
1194468 [main] bash 1382 dofork: child -1 - forked process 30320 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
usr/bin/bash: fork: retry: Resource temporarily unavailable
3399427 [main] bash 1382 dofork: child -1 - forked process 28608 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
usr/bin/bash: fork: retry: Resource temporarily unavailable
7611246 [main] bash 1382 dofork: child -1 - forked process 12080 died unexpectedly, retry 0, exit code 0xC0000142, errno 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests