go get 时报告“using incompatible versions of the cygwin DLL”问题的解决

在Windows环境下使用`go get`时遇到'using incompatible versions of the cygwin DLL'错误。安装cygwin并更新git到最新版本后,问题得到解决。详细步骤包括从cygwin官网下载安装引导文件,选择国内镜像加速,以及从GitHub下载并安装Git for Windows的最新版。

问题

src>go get -u -v github.com/gorilla/websocket
github.com/gorilla/websocket (download)
	  0 [main] sh (6776) C:\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0xB26410/0x
BB6410.
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.
	  1 [main] sh 5452 fork: child -1 - forked process 6776 died unexpectedly, retry 0, exit code 0xC0000005, errno 11
	  0 [main] sh (7968) C:\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0xB26410/0x
8D6410.
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.
1048144 [main] sh 5452 fork: child -1 - forked process 7968 died unexpectedly, retry 0, exit code 0xC0000005, errno 11
	  0 [main] sh (7856) C:\Git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0xB26410/0x
B36410.
...
33691043 [main] sh 5452 fork: child -1 - forked process 4928 died unexpectedly, retry 0, exit code 0xC0000005, errno 11
/mingw32/libexec/git-core/git-sh-setup: fork: Resource temporarily unavailable
package github.com/gorilla/websocket: exit status 254

安装cygwin

(1) 从官网www.cygwin.com/下载安装引导文件 setup-x86.exe(我的windows是32位的,64位的下载setup-x64.exe)

(2) 在选择镜像界面,填写国内镜像 https://mirrors.aliyun.com/cygwin/ (或163的镜像,速度也很快)

(3) Next, 直到安装完毕

提示: 事实上,上述错误与cygwin没有啥子关系。

测试go get,问题依旧存在

src>go get -u -v github.com/gorilla/websocket
...

解决问题

线索

https://stackoverflow.com/questions/12042363/cygwin-git-fork-error-on-pull,或许是Git工具版本的问题 (与go工具链不匹配?)

查看git版本

src>
src>git --version
git version 2.16.2.windows.1

从官网下载最新的版本

下载地址 https://github.com/git-for-windows/git/releases/
官网最新版本也只到2.20.0,2.16.2已经很新了。
抱着试试看的态度,下载最新版本,安装

查看git版本

src>git --version
it version 2.20.0.rc2.windows.1

测试go get,通过

src>
src>go get -u -v github.com/gorilla/websocket
github.com/gorilla/websocket (download)
github.com/gorilla/websocket
src>
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值