Search code examples
gitcygwin

Cygwin git fork() error on pull


The basic problem is that sometimes when I do

git pull upstream master

I get

remote: Counting objects: 172, done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 119 (delta 45), reused 95 (delta 21)
      0 [main] git 8660 fork: child -1 - forked process 4520 died unexpectedly, retry 0, exit code -1073741515, errno 11
error: cannot fork() for index-pack: Resource temporarily unavailable
fatal: fetch-pack: unable to fork off index-pack

The exit code is the same every time, the number of objects varies as doe the process numbers of course. I am running with public key authentication against github via ssh on Windows 7. It happens with and without ssh-agent. I've been having this problem for several months now, and working around it by switching over to run Git Bash (MingW32), whenever it crops up, (which is almost every time with some repositories and occasionally or never with others). However I generally prefer the Cygwin environment and have most of my stuff setup there, so it's a drag when I'm forced to do that.

A while ago I saw this post http://cygwin.com/ml/cygwin/2012-03/msg00025.html and after reading it hoped that the next time I updated Cygwin that fix would fix my issue too. It didn't, but I wasn't sure if the fix was released, but I updated again today and it's happening.

I've noticed a plethora of emails about errors relating to fork() for Cygwin git on the web, though none for pull, and so my question is, has anyone seen this on pull before, what causes it? is there any way to keep it from happening (besides patching git or cygwin or using some other implementation course :) ).

Amusingly I've seen exactly none of the errors for which I can find relevant Cygwin/git mails on the web.


Solution

  • OK, I guess I should share. I have the same problem, but I have a workaround. The problem seems to be the length of the PATH. If I do a git pull, I get the fork failure:

    $ git pull*emphasized text*
          2 [main] git 7384 fork: child -1 - forked process 7420 died unexpectedly, retry 0, exit code -1073741515, errno 11
    error: cannot fork() for rev-list: Resource temporarily unavailable
    error: Could not run 'git rev-list'
    remote: Counting objects: 728, done.
    remote: Compressing objects: 100% (456/456), done.
     907550 [main] git 7384 fork: child -1 - forked process 7436 died unexpectedly, retry 0, exit code -1073741515, errno 11
    error: cannot fork() for index-pack: Resource temporarily unavailable
    fatal: fetch-pack: unable to fork off index-pack
    

    However, if I set the PATH to something really small before running git, it works:

    $ PATH=/usr/bin git pull
    remote: Counting objects: 728, done.
    remote: Compressing objects: 100% (456/456), done.
    remote: Total 464 (delta 337), reused 9 (delta 6)
    Receiving objects: 100% (464/464), 153.36 KiB, done.
    Resolving deltas: 100% (337/337), completed with 107 local objects.
    From git://cmake.org/cmake
    

    I would be interested if it works for any of you?