检测到 Cygwin/Git 错误 cygheap 基础不匹配
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8107319/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cygwin/Git error cygheap base mismatch detected
提问by John Zumbrum
I have installed two windows servers with the latest versions of cygwin and git, and am trying to clone the git repository from S1, to S2. I can successfully ssh from S2 to S1 using RSA keys, but when I do this: git clone "ssh://root@S1/path/to/my/repo" It throws back this output:
我已经安装了两个带有最新版本的 cygwin 和 git 的 Windows 服务器,并且正在尝试将 git 存储库从 S1 克隆到 S2。我可以使用 RSA 密钥成功地从 S2 ssh 到 S1,但是当我这样做时: git clone "ssh://root@S1/path/to/my/repo" 它会返回以下输出:
Cloning into /cygdrive/c/program files/apache software foundation/apache2.2/htdocs/myfolder...
2 [main] git 2004 C:/cygwin/lib/git-core/git.exe *** fatal error - cygheap base mismatch detected - 0x61242860/0x6123790.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search fro cygwin1.dll using the WIndows Start->Find/Search facility and delete all bu the most recent version. The most recent version *should* reside in x:\cygwin\bin, where 'x' is the drive on which you have installed the cygwin distrubtion. Rebooting is also suggested if you are unable to find another cygwin DLL.
--5 more errors like that one --
remote: Counting objects: 3275, done.
remote: Compressing oobjects: 100% (3106/3106), done.
fatal: write error: Broken pipe
So I followed these instructions, but no luck. Any suggestions?
所以我遵循了这些说明,但没有运气。有什么建议?
回答by Serdar De?irmenci
I had the same problem.
我有同样的问题。
I just restartedmy PC and it worked again.
我刚刚重新启动了我的电脑,它又工作了。
It doesn't help to find reason of problem but at least you can keep on to work.
找出问题的原因无济于事,但至少您可以继续工作。
回答by White hawk
No Cygwin, no GitHub
没有 Cygwin,没有 GitHub
I've only started experiencing this lately, and none of the answers above applied to my case - I didn't have Cygwin or GitHub installed.
Instead, in my case a Windows security feature, Address Space Layout Randomization or ASLR created this problem. This is off by default for programs that do not mark themselves compatible.
However, I've enabled ASLR for all programs for additional safety. The downside is that git commands don't work now.
我最近才开始遇到这种情况,上面的答案都不适用于我的案例 -我没有安装 Cygwin 或 GitHub。
相反,在我的情况下,Windows 安全功能、地址空间布局随机化或 ASLR 造成了这个问题。对于未将自身标记为兼容的程序,默认情况下这是关闭的。
但是,我为所有程序启用了 ASLR 以提高安全性。缺点是 git 命令现在不起作用。
Solution
解决方案
The solution was to exclude ASLR for git executables.Because there're quite many of them, I had to use PowerShell as administrator:
解决方案是排除 git 可执行文件的 ASLR。因为它们很多,我不得不以管理员身份使用 PowerShell :
Get-Item -Path "C:\Program Files\Git\usr\bin\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateImages }
回答by shieldgenerator7
EDIT: I found the solution.
编辑:我找到了解决方案。
TL;DR:Go to the GitHub AppDatafolder and delete the PortableGitfolder, and restart GitHub
TL;DR:转到GitHub AppData文件夹并删除PortableGit文件夹,然后重新启动 GitHub
- Close GitHub
- Navigate to the GitHub AppData folder:
C:\Users\[username]\AppData\Local\GitHub
- Delete the folder that starts with
PortableGit
and ends in a random string of letters and numbers - Restart GitHub. It will re-extract the dlls and the problem should be fixed!
- 关闭 GitHub
- 导航到 GitHub AppData 文件夹:
C:\Users\[username]\AppData\Local\GitHub
- 删除
PortableGit
以随机字母和数字字符串开头和结尾的文件夹 - 重启 GitHub。它将重新提取dll,问题应该得到解决!
(Original "answer")
I tried a whole bunch of things, and I have no idea what actually worked in the end. I restarted GitHub, restarted my computer, uninstalled and reinstalled GitHub, uninstalled several other programs that I had recently installed but ended up not needing, deleted the GitHub folder in the AppData\Local directory, downloaded and installed cygwin, and possibly some other stuff I'm forgetting.
(原始“答案”)
我尝试了一大堆东西,但我不知道最后到底是什么真正起作用了。我重新启动了 GitHub,重新启动了我的计算机,卸载并重新安装了 GitHub,卸载了我最近安装但最终不需要的其他几个程序,删除了 AppData\Local 目录中的 GitHub 文件夹,下载并安装了 cygwin,可能还有其他一些我需要的东西我忘记了
The last attempt was finding all the cygwin1.dll files in File Explorer and renaming them to cygwin1x.dll and then restarting my computer. After I did that, it worked again.
最后一次尝试是在文件资源管理器中找到所有 cygwin1.dll 文件并将它们重命名为 cygwin1x.dll,然后重新启动我的计算机。在我这样做之后,它又起作用了。
I'm hazarding a guess here, but I'm going to say that downloading and installing cygwinand then restarting my computerdid the trick.
我在这里冒个险,但我要说的是,下载并安装 cygwin然后重新启动我的计算机就成功了。
回答by Jim Schneider
You don't mention this in your problem statement, but I am presuming you are running on a 64 bit version of Windows. Cygwin has problems running on 64 bit Windows, especially with large programs. I believe this is due to memory management issues within the cygwin1.dll support library. It looks like it's making the unsupportable assumption that it will forever and always be mapped to the same address in every process, so it's okay for it to keep process specific things (like heap addresses) in system-wide global variables.
您没有在问题陈述中提及这一点,但我假设您在 64 位版本的 Windows 上运行。Cygwin 在 64 位 Windows 上运行有问题,尤其是大型程序。我相信这是由于 cygwin1.dll 支持库中的内存管理问题。看起来它做出了一个无法支持的假设,即它将永远并且始终映射到每个进程中的相同地址,因此它可以将进程特定的内容(如堆地址)保留在系统范围的全局变量中。
In my abundant free time, I've been trying to track down the problematic bits. In the meantime, you could try rebasing cygwin1.dll itself. Be warned, that's a great whackin' lot more complicated than it needs to be - even more complicated than rebasing all of everything else.
在我丰富的空闲时间里,我一直在努力寻找有问题的部分。同时,您可以尝试重新调整 cygwin1.dll 本身。请注意,这是一个很好的打击,比它需要的要复杂得多 - 甚至比所有其他一切都更复杂。
回答by Geoff Lentsch
For me, the cause was, git was not installed through cygwin, though the regular download from git-scm. Once I ran the cygwin setup, added git, it worked perfectly.
对我来说,原因是 git 没有通过 cygwin 安装,尽管从 git-scm 定期下载。一旦我运行了 cygwin 设置,添加了 git,它就完美地工作了。
回答by Keith Thompson
Do you get this error with any other commands? With git --version
?
使用任何其他命令时是否出现此错误?与git --version
?
Try rerunning the Cygwin setup.exe
and reinstalling your cygwin1.dll
(the package is "cygwin", under "Base") and your git package (package "git" under "Devel") and rebooting.
尝试重新运行 Cygwinsetup.exe
并重新安装你的cygwin1.dll
(包是“cygwin”,在“Base”下)和你的 git 包(包“git”在“Devel”下)并重新启动。
回答by Daniel van der Garde
I know this is an old thread, but as it is the first result on this issue, I would like to add my resolution in the hope it helps someone else.
我知道这是一个旧线程,但由于它是这个问题的第一个结果,我想添加我的解决方案,希望它可以帮助其他人。
First, run cygcheck PROGRAMM
, in my case, I had an issue with tar.exe
so I ran: cygcheck tar
the cygcheck
command shows what DLL's are used.
首先, run cygcheck PROGRAMM
,在我的情况下,我遇到了一个问题,tar.exe
所以我跑了:cygcheck tar
该cygcheck
命令显示使用了哪些 DLL。
Everything looked correct in cygcheck
, so I decided, based on the comments of Jim Schneider, to switch from the 64bit version of Cygwin to the 32bit version, that ultimately solved my problem.
中的一切看起来都正确cygcheck
,所以我决定根据 Jim Schneider 的评论,从 Cygwin 的 64 位版本切换到 32 位版本,最终解决了我的问题。
回答by posix99
In my case the PATH in the Environment Variableswas wrong. I moved the cygwin a bit earlier in the path (making sure it is set before git path). That way cygwin dll was in favor of git dll.
在我的情况下,环境变量中的 PATH是错误的。我在路径中更早地移动了 cygwin(确保它在 git path 之前设置)。这样 cygwin dll 就支持 git dll。
For example; The path of C:\Program Files\Git\usr\bin;C:\cygwin\bin;...
Was changed to C:\cygwin\bin;C:\Program Filenter code herees\Git\usr\bin;...
例如; 的路径C:\Program Files\Git\usr\bin;C:\cygwin\bin;...
被更改为C:\cygwin\bin;C:\Program Filenter code herees\Git\usr\bin;...
Environment was Win7x86 and a reboot was required to that updated path is used.
环境是 Win7x86,需要重新启动才能使用更新的路径。
回答by Xavave
I had the same kind of error when trying to push to a git repo from visual studio 2017 using a script starting with #!/bin/sh from
尝试使用以 #!/bin/sh from 开头的脚本从 Visual Studio 2017 推送到 git repo 时,我遇到了同样的错误
[repo folder]\.git\hooks\commit-msg
Error message :
错误信息 :
1 [main] sh (11460) c:\program files (x86)\microsoft visual studio17\enterprise\common7\ide\commonextensions\microsoft\teamfoundation\team explorer\Git\usr\bin\sh.exe:
*** fatal error - cygheap base mismatch detected - 0x14DD408/0x12AD408.This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facilityand delete all but the most recent version.
The most recent version *should*reside in x:\cygwin\bin, where 'x' is the drive on which you haveinstalled the cygwin distribution.
Rebooting is also suggested if youare unable to find another cygwin DLL.
I tried different solutions above without success
我尝试了上述不同的解决方案但没有成功
What I did to solve the issue is copying content from :
我为解决这个问题所做的是从以下位置复制内容:
C:\Program Files\Git\usr\bin
to
到
C:\Program Files (x86)\Microsoft Visual Studio17\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\usr\bin
The issue on my computer came from a version mismatch on sh.exe, and copying these files resolved the problem
我电脑上的问题来自 sh.exe 版本不匹配,复制这些文件解决了问题
回答by Bink
I resolved this issue by temporarily disabling Windows Defender and trying again—see https://superuser.com/a/1047031/158243for details.
我通过暂时禁用 Windows Defender 并重试解决了这个问题 -有关详细信息,请参阅https://superuser.com/a/1047031/158243。