5

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?

4

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 '19 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 '19 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 '19 at 15:03
  • 1
    Should I do this for every cygwin exe file? Sep 25 '19 at 12:35
  • Yes, I'm afraid so. It can take a while. There is probably a way to script it. Sep 26 '19 at 11:11
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.