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

Windows 10 - bash.exe: fatal error in forked process - MapViewOfFileEx, Win32 error 5. #1244

Closed
1 task done
JasonGherken opened this issue Jul 19, 2017 · 11 comments
Closed
1 task done

Comments

@JasonGherken
Copy link

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

This issue is similar... #832, but it did not contain any resolution.

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.13.3.windows.1
built from commit: faaf2320f32f6ac52a69502c6b157b6ea4781f50
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 10.0.14393]
  • 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
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: ConHost
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

I ran the installer with the "Run as administrator" option, but that did not fix the issue.

Details

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

CMD

The error shows up when I start Git Bash, that is before I run any command.
  • What did you expect to occur after running these commands?
Did not expect any error message before bash prompt showed up.
  • What actually happened instead?
Following error occurred before bash prompt showed up...

   1199 [main] bash 9916 C:\Program Files\Git\usr\bin\bash.exe: *** fatal error in forked process - MapViewOfFileEx '(null)'(0x50), Win32 error 5.  Terminating.
    191 [main] bash 5072 fork: child 9916 - died waiting for dll loading, errno 11
bash: fork: retry: Resource temporarily unavailable
   4564 [main] bash 13332 C:\Program Files\Git\usr\bin\bash.exe: *** fatal error in forked process - MapViewOfFileEx '(null)'(0x50), Win32 error 5.  Terminating.
1299269 [main] bash 5072 fork: child 13332 - died waiting for dll loading, errno 11
bash: fork: retry: Resource temporarily unavailable
   2024 [main] bash 5224 C:\Program Files\Git\usr\bin\bash.exe: *** fatal error in forked process - MapViewOfFileEx '(null)'(0x50), Win32 error 5.  Terminating.
3673868 [main] bash 5072 fork: child 5224 - died waiting for dll loading, errno 11
bash: fork: retry: Resource temporarily unavailable
   5993 [main] bash 13336 C:\Program Files\Git\usr\bin\bash.exe: *** fatal error in forked process - MapViewOfFileEx '(null)'(0x50), Win32 error 5.  Terminating.
8055813 [main] bash 5072 fork: child 13336 - died waiting for dll loading, errno 11
bash: fork: retry: Resource temporarily unavailable
   3808 [main] bash 4844 C:\Program Files\Git\usr\bin\bash.exe: *** fatal error in forked process - MapViewOfFileEx '(null)'(0x50), Win32 error 5.  Terminating.
16347354 [main] bash 5072 fork: child 4844 - died waiting for dll loading, errno 11
bash: fork: Resource temporarily unavailable
bash-4.4$
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?
No
@heldersepu
Copy link

I'm getting a similar error on Windows 7 when I run command git sync on the powershell console:

Windows PowerShell
Copyright (C) 2013 Microsoft Corporation. All rights reserved.

C:\Users\sepulvedah\Documents\GitHub\hs-scripts [master ≡]> git sync
    377 [main] sh 10504 C:\Users\sepulvedah\AppData\Local\GitHub\PortableGit_f02737a78695063deace08e96d5042710d3e32db\usr\bin\sh.exe:
 *** fatal error in forked process - MapViewOfFileEx '(null)'(0x194), Win32 error 5.  Terminating.
      0 [main] sh 17288 fork: child 10504 - died waiting for dll loading, errno 11
git pull && git push: fork: retry: No child processes
     78 [main] sh 16652 C:\Users\sepulvedah\AppData\Local\GitHub\PortableGit_f02737a78695063deace08e96d5042710d3e32db\usr\bin\sh.exe:
 *** fatal error in forked process - MapViewOfFileEx '(null)'(0x194), Win32 error 5.  Terminating.
1050049 [main] sh 17288 fork: child 16652 - died waiting for dll loading, errno 11
git pull && git push: fork: retry: No child processes
      0 [main] sh 21268 C:\Users\sepulvedah\AppData\Local\GitHub\PortableGit_f02737a78695063deace08e96d5042710d3e32db\usr\bin\sh.exe:
 *** fatal error in forked process - MapViewOfFileEx '(null)'(0x194), Win32 error 5.  Terminating.
3145265 [main] sh 17288 fork: child 21268 - died waiting for dll loading, errno 11
git pull && git push: fork: retry: No child processes
      0 [main] sh 14500 C:\Users\sepulvedah\AppData\Local\GitHub\PortableGit_f02737a78695063deace08e96d5042710d3e32db\usr\bin\sh.exe:
 *** fatal error in forked process - MapViewOfFileEx '(null)'(0x194), Win32 error 5.  Terminating.
7215801 [main] sh 17288 fork: child 14500 - died waiting for dll loading, errno 11
git pull && git push: fork: retry: No child processes
     15 [main] sh 11076 C:\Users\sepulvedah\AppData\Local\GitHub\PortableGit_f02737a78695063deace08e96d5042710d3e32db\usr\bin\sh.exe:
 *** fatal error in forked process - MapViewOfFileEx '(null)'(0x194), Win32 error 5.  Terminating.
15296881 [main] sh 17288 fork: child 11076 - died waiting for dll loading, errno 11
git pull && git push: fork: Resource temporarily unavailable
C:\Users\sepulvedah\Documents\GitHub\hs-scripts [master ≡ +1 ~0 -0 !]>


@toadicusrex
Copy link

I reproduced this problem. In my case I had a process blocking application called Cylance running; it blocked a lot of Git. This was installed by our IT group on all machines, and it completely blocks Git from running (among other things). I removed it with permission and then these problems went completely away.

@heldersepu
Copy link

I can confirm that Cylance is running on the machine that I'm having the error

@heldersepu
Copy link

...and not everything is blocked git pull works!

but git sync errors out

@dscho
Copy link
Member

dscho commented Aug 4, 2017

Cylance is not (yet?) in https://cygwin.com/faq/faq.html#faq.using.bloda. Maybe it should be.

git sync

$ git sync
git: 'sync' is not a git command. See 'git --help'.

The most similar command is
        svn

@heldersepu
Copy link

@dscho
git sync is a valid command for me, I installed GitHub desktop

> git sync --help
'git sync' is aliased to '!git pull && git push'

@dscho
Copy link
Member

dscho commented Aug 5, 2017

Aliases are executed via MSYS2's Bash. Probably that is the reason for the problem, as every MSYS2 program uses the MSYS2 runtime, which has to make rather strong assumptions about the DLL loading process in order to emulate POSIX semantics.

@cyclump
Copy link

cyclump commented Aug 31, 2017

I experienced a similar issue with the Ruby 2.4 installer for Windows. The details are at oneclick/rubyinstaller2#72. After talking to our Cylance admin it turns out we had to add exclusions for pacman.exe and git.exe. They both can generate stack pivot violations. Cylance detects them and intervenes so they can't be exploited by malware.

When this happened to me, GPGme was called out as failing.

Hope this helps!

@dscho
Copy link
Member

dscho commented Sep 1, 2017

@cyclump thank you for this information!

Sounds as if Cylance needs to be added to Cygwin's BLODA...

@worthy7
Copy link

worthy7 commented Feb 23, 2018

FYI from my support ticket with Cylance; I asked if they would unblock it globally or if it is an issue git needs to fix (ok not git.exe, but the whole forking process)

Stack Pivot -
The stack for a thread has been replaced with a different stack.
Generally the system will only allocate a single stack for a thread.
An attacker would use a different stack to control execution in a way that is not blocked by Data Execution Prevention (DEP).

So, our product prevent Git as long as it take the action as Stack Pivot.
To allow only usual application, we recommend to add to white list.

Looks like it won't change and we have to whitelist forever.

@dscho
Copy link
Member

dscho commented Feb 23, 2018

@worthy7 that's a bummer. Especially since Cylance seems to be unable to understand the technical details: it is not Git that does this, it is Cygwin/MSYS2, and there are very, very good reasons that Cygwin/MSYS2 does this. Reasons that Cylance would understand, I am sure, if they bothered to inform themselves.

This is such a pity!

At least we now know where we stand, and can maybe recommend other security products.

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

No branches or pull requests

6 participants