在 git bash 脚本中使用 cygwin 可执行文件

Som*_*Dev 9 windows cygwin bash git

我有一个.sh脚本,我双击它让 git for Windows 执行它。

现在我需要convert来自 cygwin(我已经安装)的(imagemagick)并且我用它的绝对路径调用它 - /c/cygwin64/bin/convert.exe- 但我得到:

致命错误 - 检测到 cygheap 碱基不匹配。此问题可能是由于使用了不兼容的 cygwin DLL 版本。

将实际convert调用包装在 cygwin bash 调用中,甚至在cmd.exe调用中也无济于事。这有点奇怪,因为我有时会直接在.cmd脚本中使用 cygwin 可执行文件,而且总是有效。

我能做什么?将我的程序限制为一个文件的解决方案将是首选。

(我知道我可能只安装 Windows 原生 imagemagick。但是第二天我需要在 git-for-Win-Shellscript 中使用另一个 cygwin 工具......此外,我想了解这里发生了什么。而且,是的,如果可能的话,我可能会让我的工作场所中的 Windows git 过时

Dav*_*ill 8

致命错误 - 检测到 cygheap 碱基不匹配。

此问题可能是由于使用了不兼容的 cygwin DLL 版本。

此错误是由于 Git for Windows 路径与 Cywin 不兼容造成的。

  • 它们都使用/bin/usr/bin但这些映射到不同的目录(因为它们使用不同的挂载表)。

  • Cywin 希望在/usr/bin/cygwin1.dll(并且在 Git for Windows 中找不到)中找到 dll

  • 当您在 Git for Windows shell 中显式运行任何Cygwin 命令时,bashCygwin 找不到其 dll 并生成上述错误消息。

  • 注意下面的挂载映射/是不同的。

适用于 Windows 的 Git:

DavidPostill@Hal MINGW64 ~
$ mount
C:/temp on /tmp type ntfs (binary,noacl,posix=0,usertemp)
C:/apps/Git on / type ntfs (binary,noacl,auto)
C:/apps/Git/usr/bin on /bin type ntfs (binary,noacl,auto)
C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto)
E: on /e type vfat (binary,noacl,posix=0,user,noumount,auto)
F: on /f type ntfs (binary,noacl,posix=0,user,noumount,auto)

DavidPostill@Hal MINGW64 ~
$ which cygwin1.dll
which: no cygwin1.dll in (/c/Users/DavidPostill/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/DavidPostill/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/apps/WSCC/Sysinternals Suite:/c/apps/WSCC/NirSoft Utilities:/c/apps/Calibre:/cmd:/mingw64/bin:/usr/bin:/usr/bin/vendor_perl:/usr/bin/core_perl)

DavidPostill@Hal MINGW64 ~
$ /c/cygwin/bin/man
      1 [main] man (608) C:\cygwin\bin\man.exe: *** fatal error - cygheap base mismatch detected - 0x180301408/0x180304408.
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.
Segmentation fault
Run Code Online (Sandbox Code Playgroud)

赛格温:

$ mount
C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin on / type ntfs (binary,auto)
C: on /c type ntfs (binary,posix=0,user,noumount,auto)
E: on /e type vfat (binary,posix=0,user,noumount,auto)
F: on /f type ntfs (binary,posix=0,user,noumount,auto)
$ which cygwin1.dll
/usr/bin/cygwin1.dll
$ /c/cygwin/bin/man
What manual page do you want?
Run Code Online (Sandbox Code Playgroud)

除了不要混合和匹配 cygwin 派生的实用程序之外,没有其他解决方案。选择一个并坚持下去。

  • @吉姆。除了不要混合和匹配 cygwin 派生的实用程序之外,没有一个。选择一个并坚持下去。 (4认同)
  • 通过 github 链接中的解决方案修复。在 Windows 漏洞利用保护中关闭所有出错的可执行文件的 ASLR。然后它起作用了。无需为 Windows 卸载 git。它通过添加程序名称(例如uname.exe)而不是完整路径来实现。 (2认同)

归档时间:

查看次数:

10415 次

最近记录:

6 年,6 月 前