windows - 如何修复 Git bash 无法在 Windows 上运行
问题描述
我在控制面板中卸载了一些应用程序,然后我的 git bash 停止工作。
我认为它是相关的,但不确定是什么让它停止了。当我在 vscode 之外运行 bash 时,我得到以下信息(截图)
我记得卸载的唯一应用是 Windows SDK 工具和 Visual Studio Installer。
我尝试重新安装 git bash 但我仍然得到同样的错误。
我在 vs-code 终端中收到以下错误
2 [main] bash (12412) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fa
tal error - cygheap base mismatch detected - 0x1368408/0x12C8408.
This problem is probably due to using incompatible versions of the cygwin DLL.
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.
2 [main] bash 100 dofork: child -1 - forked process 12412 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
bash: fork: retry: Resource temporarily unavailable
2 [main] bash (8824) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fatal error - cygheap base mismatch detected - 0x1368408/0x1308408.
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.
1290157 [main] bash 100 dofork: child -1 - forked process 8824 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
bash: fork: retry: Resource temporarily unavailable
2 [main] bash (14364) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fatal error - cygheap base mismatch detected - 0x1368408/0x1388408.
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.
3499346 [main] bash 100 dofork: child -1 - forked process 14364 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
bash: fork: retry: Resource temporarily unavailable
2 [main] bash (7688) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fatal error - cygheap base mismatch detected - 0x1368408/0x1388408.
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.
4652774 [main] bash 100 dofork: child -1 - forked process 7688 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
bash: fork: retry: Resource temporarily unavailable
2 [main] bash (2216) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fatal error - cygheap base mismatch detected - 0x1368408/0x11D8408.
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.
6724468 [main] bash 100 dofork: child -1 - forked process 2216 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
bash: fork: retry: Resource temporarily unavailable
2 [main] bash (3380) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fatal error - cygheap base mismatch detected - 0x1368408/0x11D8408.
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.
10811431 [main] bash 100 dofork: child -1 - forked process 3380 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
bash: fork: retry: Resource temporarily unavailable
2 [main] bash (14080) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fatal error - cygheap base mismatch detected - 0x1368408/0x1308408.
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.
18892759 [main] bash 100 dofork: child -1 - forked process 14080 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
bash: fork: Resource temporarily unavailable
bash-4.4$
解决方案
从https://github.com/mintty/wsltty/issues/6复制
这是修复。
- 转到您的 Windows Defender 安全中心设置
- 点击应用和浏览器控制
- 在底部单击“漏洞利用保护设置”链接
- 转到“程序设置”并单击“添加要自定义的程序”->“选择确切的文件路径”
- 导航到“C:\Program Files\Git\usr\bin\sh.exe”并添加它
- 覆盖并关闭以下内容: Mandatory ASLR Randomize memory allocation (Bottom-up ASLR)
- 单击“应用”,现在一切正常。
还要从同一文件夹中添加这些其他二进制文件:expr.exe、uname.exe、grep.exe、rm.exe
祝你好运,加布里埃尔
推荐阅读
- android - Visual Studio 更新后 Apk 签名更改
- iis - 将子域重写为 IIS 上的子文件夹
- c++ - 如何使用 opencv 从读取缓冲区中读取 BGR 格式的 RAW 图像数据
- cmd - 找不到 tns 命令
- sql - 比较多个表
- python-3.x - 条件错误:“如果不是”条件未运行导致该条件内的变量未定义
- java - 为什么当消息正文不是时 JAX-RS 参数为空?
- javascript - 在匿名函数中获取函数的函数名
- c# - 在 ASP.NET MVC 中按数字搜索
- react-native - Expo 的 OTA 更新是否会在从商店全新下载后首次开放时启动?