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

Launching git bash gives bash fork retry error #776

Closed
novabe opened this issue Jun 8, 2016 · 34 comments
Closed

Launching git bash gives bash fork retry error #776

novabe opened this issue Jun 8, 2016 · 34 comments

Comments

@novabe
Copy link

novabe commented Jun 8, 2016

The error text is:

   0 [main] bash 9752 fork: child 11580 - died waiting for dll loading, errno 11
bash: fork: retry: No child processes
1132558 [main] bash 9752 fork: child 15412 - died waiting for dll loading, errno 11
bash: fork: retry: No child processes
3262768 [main] bash 9752 fork: child 22812 - died waiting for dll loading, errno 11
bash: fork: retry: No child processes
7399244 [main] bash 9752 fork: child 19916 - died waiting for dll loading, errno11
bash: fork: retry: No child processes
15536472 [main] bash 9752 fork: child 18504 - died waiting for dll loading, errno 11
bash: fork: Resource temporarily unavailable
bash-4.3$

This prevents at least git-stash from working:

bash-4.3$ git stash show -p
      0 [main] sh 11460 fork: child 13956 - died waiting for dll loading, errno 11
C:\Program Files\Git\mingw64/libexec/git-core\git-stash: fork: retry: No child processes
1149164 [main] sh 11460 fork: child 9660 - died waiting for dll loading, errno 11
C:\Program Files\Git\mingw64/libexec/git-core\git-stash: fork: retry: No child processes
3290531 [main] sh 11460 fork: child 16876 - died waiting for dll loading, errno11
C:\Program Files\Git\mingw64/libexec/git-core\git-stash: fork: retry: No child processes
7441948 [main] sh 11460 fork: child 12188 - died waiting for dll loading, errno11
C:\Program Files\Git\mingw64/libexec/git-core\git-stash: fork: retry: No child processes
15591618 [main] sh 11460 fork: child 8276 - died waiting for dll loading, errno11
C:\Program Files\Git\mingw64/libexec/git-core\git-stash: fork: Resource temporarily unavailable
bash-4.3$

I have tested different versions of git, and found that anything above 2.7.0 exhibits this problem for me and my coworkers (the problem starts with 2.7.0.2).

I also found http://stackoverflow.com/questions/37263702/cant-start-git-bash which implies it might be antivirus related. Creating this issue to confirm if others have experienced it, and if we know this to be antivirus related, I hope someone can recommend what to whitelist? Is it just "C:\Program Files\Git\usr\bin\bash.exe"?

@dscho
Copy link
Member

dscho commented Jun 9, 2016

Unfortunately this report does not give me enough information to even try to reproduce the problem, which would be required before I could try to diagnose and fix the bug.

@novabe
Copy link
Author

novabe commented Jun 9, 2016

@dscho Here is how I can reproduce this locally:

  • Install any version of git >= 2.7.0.2 On Windows 7
  • Open git bash

@novabe
Copy link
Author

novabe commented Jun 9, 2016

I'm somewhat convinced this is due to some corporate antivirus / security software on our Win7 machines, which for whatever reason only has an issue with git >= 2.7.0.2. Reading the change log it might have something to do with DEP/ASLR, but I don't know enough about that to be sure.

Possibly related #649, which also mentions corporate antivirus.

@iskillings
Copy link

I have the same error coming from corporate devices. Multiple people are running 2.6.1 and earlier and not having issues, but anyone who is trying to install latest release (2.8.4 as of this post) is having this error which crashes the window if they try to execute anything from the bash window.

Is there a way to download previous versions which have been fully packaged?

@landstander668
Copy link

Is there a way to download previous versions which have been fully packaged?

https://github.com/git-for-windows/git/releases

@cs96and
Copy link

cs96and commented Jun 18, 2016

Do you have cygwin installed? I had similar problems with both cygwin and git-for-windows installed if they were both using the same architecture (e.g. both 64-bit versions).

My workaround was to use the 64-bit version of cygwin and the 32-bit version of git.

@novabe
Copy link
Author

novabe commented Jun 30, 2016

@cs96and No cygwin on my machine.

@dscho
Copy link
Member

dscho commented Oct 4, 2016

I am fairly convinced that the prerelease, as well as the version v2.10.1 (due later today), fix this issue, as I suspect that domain accounts are in use.

Please test as soon as you can.

@kalbermattenm
Copy link

I had the same problem, the installer under @dscho's link resolved my problem, thanks a lot!

@novabe
Copy link
Author

novabe commented Oct 5, 2016

Just tried both prerelease-v2.10.0.windows.1.11.geda474c and v2.10.1. Problem still exists, same as before. Reverted back to v2.7.0.

@dscho
Copy link
Member

dscho commented Oct 7, 2016

@novabe please fill out the issue reporting template so I have more information to work with, then.

@Mixopteryx
Copy link

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
    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?

64 bit windows 7

$ cmd.exe /c ver

Microsoft Windows [Version 6.1.7601]

  • What options did you set as part of the installation? Or did you choose the
    defaults?
    Defaults

One of the following:

type "C:\Program Files\Git\etc\install-options.txt"

Path Option: Cmd
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?
Connected to domain network. System Center Endpoint Protection antivirus running. 
BeyondTrust PowerBroker installed (ref Issue #649). But disabling it doesn't help. (I disabled it as a service in msconfig and verified that it was stopped in task manager/Services after reboot)

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other
    Trying to use the Git Bash shortcut in the start menu
  • What commands did you run to trigger this issue? If you can provide a
    Minimal, Complete, and Verifiable example
    this will help us understand the issue.
Shortcut in start menu with:
Target: "C:\Program Files\Git\git-bash.exe" --cd-to-home
Start in: %HOMEDRIVE%%HOMEPATH%
  • What did you expect to occur after running these commands?

Default git Bash prompt

  • What actually happened instead?
      0 [main] bash 9996 fork: child 9404 - died waiting for dll loading, errno 11
bash: fork: retry: No child processes
1049566 [main] bash 9996 fork: child 6576 - died waiting for dll loading, errno 11
bash: fork: retry: No child processes
3096600 [main] bash 9996 fork: child 2092 - died waiting for dll loading, errno 11
bash: fork: retry: No child processes
7145765 [main] bash 9996 fork: child 9260 - died waiting for dll loading, errno 11
bash: fork: retry: No child processes
15189028 [main] bash 9996 fork: child 7276 - died waiting for dll loading, errno 11
bash: fork: Resource temporarily unavailable
bash-4.3$

  • Also tried:
Reverting to git 2.7.0: Works
Reverting to git 2.7.0(2): Error reappear

@dscho
Copy link
Member

dscho commented Oct 8, 2016

This looks very similar to #910 (it's also Windows 7..). Maybe there is another application interfering with the MSYS2 runtime, similar to PowerBroker, that is still running (see https://cygwin.com/faq/faq.html#faq.using.bloda for an incomplete list)? In any case, it would be good if you could test whether Cygwin works (our MSYS2 runtime is a close fork of Cygwin's runtime, therefore we inherit all those issues...).

@Mixopteryx
Copy link

Mixopteryx commented Oct 10, 2016

The FAQ you reference say that some of the applications interfere even after they have been deactivated, so it may still be PowerBroker. @OverlordQ in #649 said he stopped it by renaming a dll, which may work better. I'm not comfortable trying that.

I tried to install Cygwin, and I got similar installation errors as those shown in #910. Trying to run the shell after give different errors from git bash and a non-functional shell. I've attached the logs below.

Shell startup messages, and attempt to run ls

-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: /cygdrive/c/MyStuff/.profile: line 12: syntax error near unexpected token `$'{\r''
'bash: /cygdrive/c/MyStuff/.profile: line 12: `agent_is_running() {
-bash-4.3$ ls
-bash: ls: command not found

End of installation log:

2016/10/10 08:54:50 Changing gid back to original
2016/10/10 08:54:50 running: C:\cygwin64\bin\dash.exe "/etc/postinstall/0p_000_autorebase.dash"
2016/10/10 08:54:54 running: C:\cygwin64\bin\dash.exe "/etc/postinstall/0p_update-info-dir.dash"
2016/10/10 08:54:56 running: C:\cygwin64\bin\bash.exe --norc --noprofile "/etc/postinstall/000-cygwin-post-install.sh"
2016/10/10 08:54:57 running: C:\cygwin64\bin\bash.exe --norc --noprofile "/etc/postinstall/coreutils.sh"
2016/10/10 08:54:57 running: C:\cygwin64\bin\bash.exe --norc --noprofile "/etc/postinstall/bash.sh"
2016/10/10 08:54:57 running: C:\cygwin64\bin\bash.exe --norc --noprofile "/etc/postinstall/base-files-mketc.sh"
2016/10/10 08:55:13 abnormal exit: exit code=254
2016/10/10 08:55:13 running: C:\cygwin64\bin\bash.exe --norc --noprofile "/etc/postinstall/base-files-profile.sh"
2016/10/10 08:55:30 abnormal exit: exit code=254
2016/10/10 08:55:30 running: C:\cygwin64\bin\bash.exe --norc --noprofile "/etc/postinstall/ca-certificates.sh"
2016/10/10 08:55:49 running: C:\cygwin64\bin\bash.exe --norc --noprofile "/etc/postinstall/man-db.sh"
2016/10/10 08:55:50 running: C:\cygwin64\bin\bash.exe --norc --noprofile "/etc/postinstall/mintty.sh"
2016/10/10 08:55:50 Changing gid to Administrators
2016/10/10 08:58:09 note: Installation Complete
2016/10/10 08:58:09 Ending cygwin install

I blame PowerBroker.

@dscho
Copy link
Member

dscho commented Oct 10, 2016

-bash: $'\r': command not found -bash: /cygdrive/c/MyStuff/.profile: line 12: syntax error near unexpected token `$'{\r''

That looks like your C:\MyStuff\.profile has DOS line endings... You may want to fix that using dos2unix. After that, the Cygwin Bash might work as you expect.

@Mixopteryx
Copy link

My .profile has DOS line endings. To check if thats the problem I renamed it to something else and restarted the cygwin terminal. This time I don't get any error messages, but ls and most other commands I've tried still don't work. It seems like my path is messed up. If I use the full path /bin/ls.exe I get the expected result.

So then it may seem like I don't get the fork error with cygwin.

@hmusavi
Copy link

hmusavi commented Feb 17, 2017

I also had the same problem and it went away when I installed v2.7.0.

@dscho
Copy link
Member

dscho commented Feb 20, 2017

@hmusavi are you also on Windows 7?

@hmusavi
Copy link

hmusavi commented Feb 21, 2017

@dscho yes. The error only happens on my Windows 7 machine. I have Windows 10 as well and that issue does NOT occur with the latest Git version.

@dscho
Copy link
Member

dscho commented Feb 22, 2017

I tried to reproduce the bug, installing Windows 7 into a VM. I do not get that error. Maybe I have to install PowerBroker to reproduce the problem? But that would be quite an unreasonable burden on me, given that I have to take care of so many other tickets that are still open, I am sure you understand.

@hmusavi
Copy link

hmusavi commented Feb 22, 2017

Thank you @dscho! I understand. You are probably correct to assume that PowerBroker is the culprit. I do have PowerBroker running on my Windows 7 machine.

@dscho
Copy link
Member

dscho commented Feb 23, 2017

@hmusavi and there is no chance you can disable it temporarily just to make sure that it is the issue, eh?

@hmusavi
Copy link

hmusavi commented Feb 23, 2017

I'm afraid not easily. Corporate policy. I'll see if I can have our IT department to disable it temporarily so I could do the test and then re-enable it. I'll get back to you but it may take a while.

@Mixopteryx
Copy link

@hmusavi: Note that disabling might not be enough, you might need to uninstall it. See posts earlier in the thread.

@OverlordQ
Copy link

If you have access to modify your registry, if you navigate to HKLM\SOFTWARE\Policies\BeyondTrust\PBDesktops there should be a key of ExcludedProfilerApps, if it's there, just add *\sh.exe to the list. If not, can create one of type REG_EXPAND_SZ.

This was the workaround discovered when I worked with BeyondTrust trying to diagnose the issue.

(Sorry for the double post, commented under wrong account)

@peblpebl
Copy link

I have the same problem;
Windows 7 64.
Newest version does not work.
2.7.0 does work.
PowerBroker installed.

As soon as I added the the git install dir to ExcludedProfilerApps it worked.

@dscho
Copy link
Member

dscho commented Feb 24, 2017

If you have access to modify your registry, if you navigate to HKLM\SOFTWARE\Policies\BeyondTrust\PBDesktops there should be a key of ExcludedProfilerApps, if it's there, just add *\sh.exe to the list. If not, can create one of type REG_EXPAND_SZ.

This was the workaround discovered when I worked with BeyondTrust trying to diagnose the issue.

Excellent! Thank you for sharing this solution!

@hmusavi
Copy link

hmusavi commented Mar 10, 2017

If you have access to modify your registry, if you navigate to HKLM\SOFTWARE\Policies\BeyondTrust\PBDesktops there should be a key of ExcludedProfilerApps, if it's there, just add *\sh.exe to the list. If not, can create one of type REG_EXPAND_SZ.
This was the workaround discovered when I worked with BeyondTrust trying to diagnose the issue.

Thank you @OverlordQ for your post. The workaround/solution works perfectly.

@dscho
Copy link
Member

dscho commented Mar 10, 2017

Under the assumption that PowerBroker was also at fault for the original poster, and that the workaround helps, I close this ticket.

@dscho dscho closed this as completed Mar 10, 2017
@peblpebl
Copy link

It helps, but not really a good solution as - at least mine - BeyondTrust resets the registry entry after approx 60 min.
But there is nothing this project really can do about it.

@dscho
Copy link
Member

dscho commented Mar 10, 2017

Sorry that it is not an ideal solution. If you figure out what broke in git-for-windows/msys2-runtime@4c36272...84870b7 (reflecting the change in the msys2-runtime as per 2.7.0's etc/package-versions.txt vs 2.7.0.2's), we may be able to figure out how to fix it.

@OverlordQ
Copy link

I'll try to find some free time and see if I can figure out a way to do an automated bisect.

@Tasgall
Copy link

Tasgall commented May 26, 2017

I have the same output and issue on my work machine - I downgraded to 2.7.0 as suggested and that worked flawlessly, but apparently policy dictates that git be no older than 2.7.3 because reasons, so I was forced to "upgrade" - 2.7.3 worked still, barring some permissions issues on first run (separate, less critical, issue), so I decided to bisect all the releases of GFW until current and found that 2.9.3.2 is the highest version that doesn't give the fork error, 2.9.3.3 (pre-release) is when it starts happening for me.

Note: I have neither BeyondTrust/PowerBroker installed, nor the specific antivirus mentioned in the linked thread, though I'm not discounting corporate antivirus as a possibility.

@dscho
Copy link
Member

dscho commented May 29, 2017

Could you compare the /etc/package-versions.txt files of the last working and of the first failing Git version? That may give us a hint which direction to dig.

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