Cygwin git fork() error on pull

痴心易碎 提交于 2019-12-20 09:24:21

问题


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.


回答1:


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?




回答2:


This is addressed here: http://cygwin.wikia.com/wiki/Rebaseall

In short, close all windows and run this:

C:\cygwin\bin\dash.exe -c '/usr/bin/rebaseall -v'

This fixes all related issues with forking. I had issues with forking aspell from emacs as well as git.




回答3:


I also faced same problem and restart of the system resolved it.




回答4:


I get that some time has passed, but I found this searching for my own very similar issue, using the cygwin platform built into the MobaXterm app. Was pulling my nonexistent hair out trying to figure it out, in the end it was fixed by a simple restart.

I double verified that this worked with a second Windows 10 machine, a new installation of MobaXterm + git apps, and an attempt to pull from a github repo. Same error: "error: cannot fork() for index-pack: Resource temporarily unavailable" was achieved, and a simple computer reboot fixed it.




回答5:


Instead of setting the PATH variable or using git's full path (once), this should work as well:

git=`which git`
git pull

This will assign git to it's full path for consecutive calls. Now, if git is used in another program(like make), it will be able to.



来源:https://stackoverflow.com/questions/12042363/cygwin-git-fork-error-on-pull

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!