简体   繁体   English

windows 的 git 中的 cygheap 不匹配错误

[英]cygheap mismatch error in git for windows

Trying to run a shell script in Git Bash.尝试在 Git Bash 中运行 shell 脚本。 This particular script requires the Rcpp and RcppArmadillo packages.这个特定的脚本需要 Rcpp 和 RcppArmadillo 包。 (creating an R package implemented in C++) Because I am on a Windows system I had to install Rtools40. (创建一个用 C++ 实现的 R package)因为我在 Windows 系统上,所以我必须安装 Rtools40。 Upon execution of the sh command I get the error:执行sh命令后出现错误:

fatal error - cygheap base mismatch detected - 0x180316408/0x180317408.
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.

What I've tried:我试过的:

  1. Following the instructions in the error message.按照错误消息中的说明进行操作。 However, a search for cygwin1.dll comes up empty.但是,搜索 cygwin1.dll 是空的。 Additionally, I have never installed Cygwin on my machine.此外,我从未在我的机器上安装过 Cygwin。
  2. Updating R, Rtools40, and Git for Windows to the latest versions.将 Windows 的 R、Rtools40 和 Git 更新到最新版本。 This was much needed (apparently Windows doesn't update these programs automatically sigh ) but it did not resolve the error message.这是非常需要的(显然 Windows 不会自动更新这些程序sigh )但它没有解决错误消息。
  3. Turning off ASLR protections in Windows Security settings as described in this post and this post .本文本文所述,在 Windows 安全设置中关闭 ASLR 保护。
  4. Deleting duplicate msys-2.0.dll files from my drive.从我的驱动器中删除重复的 msys-2.0.dll 文件。 This ultimately worked.这最终奏效了。 I will post the solution in detail as an answer to this question.我将详细发布解决方案作为这个问题的答案。

Hope this helps anyone who, like me, has been sifting through the many posts that don't fully answer this question.希望这对像我一样一直在筛选许多没有完全回答这个问题的帖子的人有所帮助。

So here's how I solved this problem.所以这就是我解决这个问题的方法。 From what I understand, the error message in Git Bash is outdated and deceptive.据我了解,Git Bash 中的错误消息已过时且具有欺骗性。 It references Cygwin, but Git Bash actually uses MSYS2, not Cygwin.它引用了 Cygwin,但 Git Bash 实际上使用的是 MSYS2,而不是 Cygwin。 So instead of searching for cygwin1.dll, I needed to search my drive for msys-2.0.dll.因此,我不需要搜索 cygwin1.dll,而是需要在我的驱动器中搜索 msys-2.0.dll。 This file was present in two locations: Git\usr\bin and rtools40\SOMETHING (I don't remember the exact path, but it was associated with Rtools40).该文件存在于两个位置:Git\usr\bin 和 rtools40\SOMETHING(我不记得确切的路径,但它与 Rtools40 相关联)。 As per the directions in the error message, I deleted the version that was older, which happened to be the one associated with Rtools40.根据错误消息中的说明,我删除了较旧的版本,它恰好是与 Rtools40 关联的版本。 That left only one version of msys-2.0.dll on my drive, and the sh command then executed in Git Bash with no issues.我的驱动器上只剩下一个版本的 msys-2.0.dll,然后在 Git Bash 中执行sh命令没有问题。

What I'm still confused about: Why hasn't the error message in Git Bash been updated?我仍然感到困惑的是:为什么没有更新 Git Bash 中的错误消息? What's the difference between Cygwin and MSYS2? Cygwin 和 MSYS2 有什么区别? I know they both impose the UNIX environment on Windows, but are there advantages or disadvantages to one or the other?我知道他们都在 Windows 上强加了 UNIX 环境,但是其中一个有优点还是缺点? In the long run, if I want to execute scripts through the command line, is Git Bash sustainable, or should I just create a Linux partition on my machine?从长远来看,如果我想通过命令行执行脚本,Git Bash 是否可持续,或者我应该在我的机器上创建一个 Linux 分区?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM