web-dev-qa-db-ja.com

git bashスクリプトでcygwin実行可能ファイルを使用する

.shスクリプトをダブルクリックして、git for Windowsで実行します。

今、私はcygwin(インストール済み)から(imagemagick)convertを必要とし、それを絶対パス-/c/cygwin64/bin/convert.exeで呼び出していますが、次のようになります:

致命的なエラー-Cygheapベースの不一致が検出されました。この問題は、cygwin DLLの互換性のないバージョンを使用していることが原因と考えられます。

実際のconvert呼び出しをcygwin bash呼び出しでラップするか、cmd.exe呼び出しでラップしても役に立たない。私は時々.cmdスクリプトで直接cygwin実行可能ファイルを使用するため、これは少し奇妙であり、それは常に機能しました。

私に何ができる?プログラムを1つのファイルに制限するソリューションが推奨されます。

(私はおそらくWindowsネイティブのimagemagickをインストールすることができることを知っています。しかし、翌日にはgit-for-Win-Shellscriptに別のcygwinツールが必要です。また、ここで何が起こっているのかを理解したいと思います。そして、はい、私はおそらく 職場のgit for Windowsを廃止する 可能であれば)

9
SomeDev

致命的なエラー-Cygheapベースの不一致が検出されました。

この問題は、cygwin DLLの互換性のないバージョンを使用していることが原因と考えられます。

このエラーは、Git for WindowsパスがCywinと互換性がないために発生します。

  • どちらも/bin/usr/binを使用しますが、これらは異なるディレクトリにマッピングされます(異なるマウントテーブルを使用するため)。

  • Cywinはdllが/usr/bin/cygwin1.dllにあることを期待しています(Git for Windowsにはありません)

  • Git for Windows bashシェルでany Cygwinコマンドを明示的に実行すると、Cygwinはそのdllを見つけられず、上記のエラーメッセージを生成します。

  • /のマウントマッピングが異なることに注意してください。

Git for Windows:

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

Cygwin:

$ 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?

Cygwinから派生したユーティリティを混ぜて一致させないこと以外に解決策はありません。 1つを選んで、それに固執してください。

7
DavidPostill

私はWindows 10でも同じ問題を抱えていました。cygwin.dllが1つも見つからないのに、CygWinのバージョンをたくさん持つことができるのかと思っていました。 GitExtensions-> StashとGit Bashが異なるエラーメッセージでクラッシュしました。解決策はここにあります:Windows Defender-> App&browser control-> Exploit protectionに移動します。 ASLRで3つのオプションをオフにします。その後システムを再起動する必要がありますが、それは本当に役立ちます!

0
Ilya Denisov