Search code examples
windowsgitbashcygwin

Is there any fix (or workaround) to Git-2.11.0 (3) 64-bit bug in handling double slashes?


I freshly installed the latest & greatest Git-2.11.0.3-64-bit.exe from https://git-for-windows.github.io/.

Installation went well, but when I opened Git Bash and typed git status, I received this error:

bash: /mingw64/bin/git: Bad address

Huh?? Running ldd $(which git) yields:

ntdll.dll => /c/windows/SYSTEM32/ntdll.dll (0x7ff8d85f0000)
KERNEL32.DLL => /c/windows/system32/KERNEL32.DLL (0x7ff8d6050000)
KERNELBASE.dll => /c/windows/system32/KERNELBASE.dll (0x7ff8d5cb0000)
LIBEAY32.dll => /mingw64/bin/LIBEAY32.dll (0x63080000)
libiconv-2.dll => /mingw64/bin/libiconv-2.dll (0x66000000)
libintl-8.dll => /mingw64/bin/libintl-8.dll (0x61cc0000)
libpcre-1.dll => /mingw64/bin/libpcre-1.dll (0x69140000)
zlib1.dll => /mingw64/bin/zlib1.dll (0x62e80000)
ADVAPI32.dll => /c/windows/system32/ADVAPI32.dll (0x7ff8d80d0000)
msvcrt.dll => /c/windows/system32/msvcrt.dll (0x7ff8d61a0000)
USER32.dll => /c/windows/system32/USER32.dll (0x7ff8d6520000)
WS2_32.dll => /c/windows/system32/WS2_32.dll (0x7ff8d66a0000)
libssp-0.dll => /mingw64/bin/libssp-0.dll (0x68ac0000)
GDI32.dll => /c/windows/system32/GDI32.dll (0x7ff8d7b10000)
sechost.dll => /c/windows/SYSTEM32/sechost.dll (0x7ff8d7e70000)
RPCRT4.dll => /c/windows/system32/RPCRT4.dll (0x7ff8d7c60000)
NSI.dll => /c/windows/system32/NSI.dll (0x7ff8d6250000)

Scratching my head I searched for this error message on the web and, sure enough, I found that "Git for Windows doesn't like having entries containing \\ or // ".

Then again, this Google Group post suggests that this bug is supposed to be fixed in v2.11.1 release.

Unfortunately, my system runs not only Git, but Cygwin and Emacs as well, and they rely on some network shares in their paths, like //myserver/home/bin. In fact both Emacs and Cygwin expect $HOME to be //myserver/home.

So, until Git for Windows v2.11.1 is released, is there a way to fix Git for Windows to behave nicely with //?

Some config file I can edit that affects how C:\Program Files\Git\git-bash.exe sees the inherited %PATH%?


Solution

  • I had the same exact issue several months ago and the fix was very simple: Go to your environment variables, and edit any such env var (e.g. %HOME%, %PATH%) to replace \\server\share with S:\.

    You of course need to first map \\server\share toS:\.