6

When using git on Windows 10 (1803), some commands give the following error:

git submodule add https://github.com/..../......git ......
      3 [main] basename (13656) C:\.....\basename.exe: *** fatal error - cygheap base mismatch detected - 0x64313400/0x11E3400.
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.

How can I resolve this issue?

1

4 Answers 4

5

There are several possible reasons for this error.

For example, you could indeed have a clashing version of the DLL.

However, recent versions of Windows 10 have a set of additional protection features built in that were originally part of Microsoft EMET.

Most notably, the ASLR (Address Space Layout Randomization) security feature is not compatible with the UNIX-like executables included with the Git for Windows installation.

In order to fix this issue, open the Exploit Protection settings, switch to the Program Settings tab and add the executable names listed in the errors (you may have quite a number).

In the example given, you can enter just basename.exe or the full path if you are a little more paranoid.

For each executable, turn off the ASLR protection.

For further reference, please see the following GitHub issue:

https://github.com/desktop/desktop/issues/3096

8
  • 1
    This is awesome! Clear and brillant. Thank you for such detailed explanation. Learned a lot today!
    – MensSana
    Apr 2, 2019 at 17:28
  • I have the same problem here: stackoverflow.com/questions/56201929/… . Don't know what are the name of the programs I must add? May 18, 2019 at 19:48
  • 1
    Notice the 2nd line of output in the original question? It shows you the exe you need to add. May 19, 2019 at 15:03
  • 1
    Should I do this for every cygwin exe file? Sep 25, 2019 at 12:35
  • Yes, I'm afraid so. It can take a while. There is probably a way to script it. Sep 26, 2019 at 11:11
1

After enabling Mandatory ALSR by default on Windows 10.

I need to disable ForceRelocateImages to all git-bash executables. Todo this, create a small PowerShell script or type direct in PowerShell the code below. You need to run PowerShell as an administrator.

Get-Item -Path "C:\Program Files\Git\usr\bin\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateImages }
Get-Item -Path "C:\Program Files\Git\bin\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateImages }
Get-Item -Path "C:\Program Files\Git\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateImages }

After that, git-bash works fine.

0

For me, the solution was to remove an incompatible msys-2.0.dll. The error message about "cygwin" is incorrect.

If you have multiple msys-2.0.dll files on the box, it can cause issues. Remove them all except the one that lives next to your git commands themselves (c:\program files\git....)

Or if you need multiple versions, muck with the PATH so that when you're using git command the MSYS64 dll version isn't found.

0
  1. Renaming msys dll might help: https://stackoverflow.com/a/74463416/2377343

  2. You might try disabling ASLR: https://stackoverflow.com/a/76296598/2377343

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .