3
votes

I am receiving errors below when I try to push changes(not a problem with memory, or other already issues already mention on stackoverflow), errors are gone when I uninstall latest version and install

1.9.x

verion. Please consider this if you are having the same issue

  • fatal: mmap failed: No error
  • fatal: The remote end hung up unexpectedly
  • fatal: The remote end hung up unexpectedly
  • fatal: write error: Bad file descriptor
  • error: failed to push some refs to
5
Can you try with git for windows 2.5.3 installed just through its archive (meaning no setup.exe, just an unzip in any folder of your choice): github.com/git-for-windows/git/releases/download/…VonC

5 Answers

6
votes

This specific error just got fixed (or at least mitigated) with git-for-windows 2.6.2 (Oct. 19th, 2015)

We no longer run out of page file space when git fetching large repositories.

(applies for push too)

See PR 486: Better mmap() emulation:

a simple git fetch would produce this error output:

fatal: mmap failed: No error
fatal: write error: Invalid argument

The reason was that several bits of our mmap() emulation left room for improvement. This Pull Request tries to close the gap.

That involves compat/win32mmap.c, and that fix is not yet updated upstream (in git/git)

8
votes

git status

fatal: mmap failed: Invalid argument

Happened to me after failing to sync my OneDrive files. Its sorted now.

3
votes

I faced the same issue, and realised that OneDrive was paused. If the files are "online", the files will be fetched automatically, but not if OneDrive is paused or not running:

git reset --hard <hash>
fatal: mmap failed: Invalid argument
2
votes

I was also getting a similar error message when trying to stage an entire folder structure into a new git repo: "fatal: mmap failed: Invalid argument". This error was occurring even though I am using git version 2.8.

After investigating further I found that the best way to debug the problem was to use git add with the verbose option:

git add -A -v

That way I could see exactly which file was causing the failure. With -v I could see that git add failed on a zip file that was about 17MB. So I excluded zip files. Which I don't really need to track.

It then failed again with the same message on a file named "user.fdb.new" which was a rename of a Firebird data base file that was only about 2MB. So I excluded that entire folder. I was then able to complete the staging.

I'm not sure what the problem is but it seems to be related to file type maybe not just file size.

In the end my git repository included about 1600 files spread across 150 folders and encompasing what I thought was about 2GB though the resulting git repo is only about 24MB. I think the largest file is 12MB.

I am running:

git version 2.8.1.windows.1 on Windows XP SP3
0
votes

My disk space was full and I accidentaly tried to stage a large binary file. After deleting the large file the stage went fine.