在 Windows 10 上使用 git 时,如何修复错误“致命错误 - 检测到 cygheap 基不匹配”?

Jul*_*ght 5 cygwin git windows-10

在 Windows 10 (1803) 上使用 git 时,某些命令会出现以下错误:

git submodule add https://github.com/..../......git ......
      3 [main] basename (13656) C:\.....\basename.exe: *** fatal error - cygheap base mismatch detected - 0x64313400/0x11E3400.
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.
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

Jul*_*ght 5

导致此错误的可能原因有多种。

例如,您确实可能拥有 DLL 的冲突版本。

但是,最新版本的 Windows 10 内置了一组附加保护功能,这些功能最初是 Microsoft EMET 的一部分。

最值得注意的是,ASLR(地址空间布局随机化)安全功能与 Windows 版 Git 安装中包含的类 UNIX 可执行文件不兼容。

为了解决此问题,请打开漏洞利用保护设置,切换到程序设置选项卡并添加错误中列出的可执行文件名称(您可能有很多)。

在给出的示例中,basename.exe如果您更偏执一点,您可以仅输入或完整路径。

对于每个可执行文件,关闭 ASLR 保护。

如需进一步参考,请参阅以下 GitHub 问题:

https://github.com/desktop/desktop/issues/3096