web-dev-qa-db-fra.com

Utilisez Cygwin Executable dans le script Git Bash

J'ai un .sh script que j'ai double-cliquez pour l'avoir exécuté par GIT pour Windows.

Maintenant, j'ai besoin (ImageMagick) convert de Cygwin (que j'ai installé) et que je l'appelle avec son chemin absolu - /c/cygwin64/bin/convert.exe - mais je reçois:

erreur fatale - Mismatch de base Cygheap détectée. Ce problème est probablement dû à l'utilisation de versions incompatibles de la DLL Cygwin.

Envelopper le réel convert appelle dans un appel de Bash Cygwin, ou même dans un cmd.exe appel, n'aide pas. Ceci est un peu étrange car j'utilise parfois des exécutables Cygwin directement dans .cmd scripts, et cela a toujours travaillé.

Que puis-je faire? Une solution qui conserve mon programme limitée à un fichier serait préférable.

(Je sais que je pourrais probablement simplement installer ImageMagick Windows-NativeMagick. Mais ensuite le lendemain, j'ai besoin d'un autre outil de cygwin dans une git-for-win-shellscript .. En outre, j'aimerais comprendre ce qui se passe ici. Et oui, Je vais probablement faire git pour Windows obsolète sur mon lieu de travail , si possible)

9
SomeDev

erreur fatale - Mismatch de base Cygheap détectée.

Ce problème est probablement dû à l'utilisation de versions incompatibles de la DLL Cygwin.

Cette erreur est causée car le chemin GIT pour Windows est incompatible avec la cywin.

  • Ils utilisent tous les deux /bin et /usr/bin Mais cette carte à répertoires différents (car ils utilisent différentes tables de montage).

  • Cywin s'attend à trouver la DLL dans /usr/bin/cygwin1.dll (et ne se trouve pas dans GIT pour Windows)

  • Lorsque vous exécutez explicitement n'importe quel commande Cygwin dans un git pour Windows bash shell cygwin ne trouve pas sa DLL et génère le message d'erreur ci-dessus.

  • Avis ci-dessous que la mappage de mont pour / est différent.

Git pour 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?

Il n'y a pas de solution, autre que ne mélangez pas et ne correspond à des utilitaires dérivés de cygwin. Choisissez en un et gardez le.

7
DavidPostill

J'avais le même problème sur Windows 10. Je me demandais comment il est-il possible d'avoir de nombreuses versions de Cygwin, tandis que je ne trouve même pas un cygwin.dll. Gitextensions-> Stash et Git Bash ont été écrasés avec différents messages d'erreur. La solution est ici: Accédez à Windows Defender -> Contrôle des applications et du navigateur -> Exploitez la protection. Et éteignez trois options avec ASLR. Vous devez redémarrer votre système par la suite, mais cela aide vraiment!

0
Ilya Denisov