Github / Cygwin错误:检测到cygheap碱基错配

时间:2016-01-23 04:25:00

标签: git github cygwin

Git一直在给我这个错误

    0 [main] sh (47116) C:\Users\Marcus\AppData\Local\GitHub\PortableGit_c7e0cbde92ba565cb218a521411d0e854079a28c\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x11C7400/0x1297400.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and 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 have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.
    0 [main] sh 42052 fork: child -1 - forked process 47116 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
/mingw32/libexec/git-core/git-sh-setup: fork: retry: No child processes
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and 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 have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.
    0 [main] sh 42052 fork: child -1 - forked process 47116 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
/mingw32/libexec/git-core/git-sh-setup: fork: retry: No child processes

我尝试过的事情包括:

  • C:\cygwinC:\cygwin64删除cygwin并重新安装
  • 使用卸载程序和安装程序重新安装github。
  • 卸载github并手动删除其本地和漫游的appdata文件夹,然后重新安装。
  • 重新启动计算机
  • 重新定位C:\cygwin,它成功了,但没有解决任何问题。
  • 重新定位%appdata%\Local\Github\PortableGit_c7e...\.它再次返回原始错误。

供参考,我正在运行Windows 10 64位。我能找到的唯一另一个问题就是针对我从未达成解决方案的错误:link here

我不确定除了完全重新安装Windows之外的其他地方,我们将非常感谢任何帮助。

7 个答案:

答案 0 :(得分:12)

来自git-for-windowsbased on msys2)的shell不应在Cygwin中运行,也不应在msys2的不同安装中运行。

GitHub Desktop使用old git-for-windows (2.5.3, Sept. 2015)

对于git bash会话,您不需要Cygwin或GitHub Desktop。

解压缩latest git-for-windows azrchive you can find

然后:

cd c:\prgs\git
mklink /J latest PortableGit-2.7.0-64-bit
set GIT_ROOT=c:\prgs\git\latest
set PATH=%PATH%;%GIT_ROOT%;%GIT_ROOT%\bin;%GIT_ROOT%\cmd;%GIT_ROOT%\us`\bin

然后,您将能够键入git-bash以启动基于Linux的bash会话。

或者,从常规CMD shell会话中,您将可以访问200多个unix命令(curlcatxargsls, ...)。
不需要Cygwin。

答案 1 :(得分:5)

我有一个非常类似的问题,但既没有重启也没有重新安装git或cygwin帮助。我总是得到:

      1 [main] sh (12220) C:\Program Files\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x37C7408/0x38E7408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and 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 have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.
      0 [main] sh 6928 fork: child -1 - forked process 12220 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
C:\Program Files\Git\mingw64/libexec/git-core\git-stash: fork: retry: Resource temporarily unavailable

我花了一段时间才弄清楚它是在我读到与“系统级强制ASLR”相关的Windows错误之后开始的,以及通过Windows UI提供的设置如何设置正确的注册表项。通过添加此注册表项使我的系统更安全后,cygwin forking破坏了:

Windows Registry Editor Version 5.00 
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel]
"MitigationOptions"=hex:00,01,01,00,00,00,00,00,00,00,00,00,00,00,00,00

来源:Clarifying the behavior of mandatory ASLR

导致git-stash不再工作,cygwin工作(我后来安装)。 删除该注册表项再次修复了该问题。

答案 2 :(得分:5)

在系统的Windows Defender安全中心中禁用Force randomization for images (mandatory ASLR)。 或exclude ASLR for git executables

Get-Item -Path "C:\Program Files\Git\usr\bin\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateImages }

答案 3 :(得分:4)

重新启动为我修复了它。我可能因为升级Git for Windows而出现此错误。在做任何其他疯狂的事情之前尝试重新启动!

答案 4 :(得分:2)

对我来说好了类似的错误ffmpeg $ ./configure ...

License: LGPL version 2.1 or later
Creating config.mak, config.h, and doc/config.texi...
      1 [main] cmp (5984) C:\Program Files\Git\usr\bin\cmp.exe: *** fatal error - cygheap base mismatch detected - 0x180326400/0x180330400.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and 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 have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.

表示"您正在尝试使用MSYS2进行构建,但意外地故障转移到某些git分布式cmp.exe文件,这些文件显然是不可用的" (见VonC的回答)。

修复我的情况:将它们安装到MSYS2中:

$ pacman -S make

$ pacman -S diffutils # for cmp package

答案 5 :(得分:0)

您安装的MSYS2中的某些软件包与x:\ cygwin \ bin冲突,因此只需在系统环境中删除MSYS2 PATH

答案 6 :(得分:0)

在Windows 10上默认启用强制性ALSR之后。

我需要对所有git-bash可执行文件禁用ForceRelocateImages。 为此,请创建一个小的PowerShell脚本或直接在PowerShell中键入以下代码。您需要以管理员身份运行PowerShell。

Get-Item -Path "C:\Program Files\Git\usr\bin\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateImages }
Get-Item -Path "C:\Program Files\Git\bin\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateImages }
Get-Item -Path "C:\Program Files\Git\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateImages }

之后,git-bash可以正常工作。