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

Github/Cygwin错误:检测到cygheap基不匹配,git,github,cygwin,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 usi

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:\cygwin
    C:\cygwin64
    中删除cygwin并重新安装
  • 使用卸载程序和安装程序重新安装github
  • 卸载github并手动删除其本地和漫游appdata文件夹,然后重新安装
  • 重新启动计算机
  • 重新设置
    C:\cygwin
    ,它成功了,但没有解决任何问题
  • 重新设置
    %appdata%\Local\Github\PortableGit\u c7e…\。
    它再次返回原始错误
作为参考,我运行的是64位windows 10。我唯一能找到的另一个问题是,pin指出了我从未得到解决的错误:

我不知道除了完全重新安装windows之外还能去哪里,任何帮助都将不胜感激。

来自()的shell不打算在Cygwin或其他msys2安装中运行

使用

对于git bash会话,您不需要Cygwin或GitHub桌面

解压缩:

  • =>
    c:\prgs\git\PortableGit-2.7.0-64位
然后:

然后,您可以键入
gitbash
来启动基于linux的bash会话

或者,通过常规的
CMD
shell会话,您可以访问200多个unix命令(
curl
cat
xargs
ls
,…)。

不需要Cygwin。

对我来说,确定一个类似的错误
ffmpeg$。/configure

意思是“您试图使用MSYS2构建,但意外地故障转移到一些git分发的cmp.exe文件,这些文件显然无法使用”(请参阅VonC的答案)

在我的情况下修复:将它们正确安装到MSYS2中:

$ pacman -S make

$ pacman -S diffutils # for cmp package

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

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

我遇到了一个非常类似的问题,但是重新启动或重新安装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
资料来源:

这导致git存储不再工作,cygwin也无法工作(我后来安装了它)。 再次删除该注册表项修复了该问题。

在系统的Windows Defender安全中心中禁用。 或:


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

我需要对所有git bash可执行文件禁用ForceRelocateImage。 为此,请创建一个小的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工作正常。

谢谢!这是一个很大的帮助,肯定解决了问题。我现在可以从命令行、powershell和git bash中使用git!但如果您不介意,我还有一点后续工作要做?我应该如何让github将新的工作git命令识别为要使用的命令?因为即使我尝试替换它的便携工具git与新工作的git一起,它会覆盖它,错误随之发生。@MarcusGosselin我以前在GitHub Desktop中尝试更改git,但…我遇到了与您相同的问题:。我更喜欢打开一个独立的shell(我控制的shell)在那里我可以使用我想要的Git。我也面临同样的问题,但当我从GitHub桌面访问Git shell时。当我从独立的Powershell打开目录时,Git工作正常。有什么想法吗?因此你的编辑提到了不兼容的msys2安装。明白了。+1类似的情况在这里!我认为Windows 10 Fall Creators更新附带了新的Windows Defender中的“漏洞保护”设置面板,其中一个是“强制ASLR”“。默认情况下它是禁用的,但我不久前启用了它,它破坏了
git stash
。禁用它并重新启动Windows解决了这个问题。Pentadrian在下面提到的一个更好的主意是,仅对与git相关的可执行文件禁用强制ASLR。我在默认情况下启用了此功能,执行此解决方案就解决了这个问题。
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
Get-Item -Path "C:\Program Files\Git\usr\bin\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateImages }
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 }