You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Desktop barfs with cygheap base mismatch detected #3096
1 [main] sh (21312) C:\Users\bdorrans\AppData\Local\GitHubDesktop\app-1.0.4\resources\app\git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x2FA7408/0x2D97408.
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.
There is no cygwin1.dll anywhere on any disk that I can find.
Git standalone, version 2.14.2.windows.3, 32bit is installed. It is higher in the path, however uninstalling it and rebooting made no difference.
Version
GitHub Desktop version: [1.04]
OS version: Microsoft Windows [Version 10.0.16299.19]
Running the bundled shell C:\Users\bdorrans\AppData\Local\GitHubDesktop\app-1.0.4\resources\app\git\usr\bin\sh.exe and then trying git gives the same error.
I talked with @blowdart a bit on Twitter and he mentioned that a clone in Visual Studio 15.4.0 also fails (let's assume it's the same way), but a clone with the full Git for Windows works fine.
This might mean it's related to MinGit and how it's generated. Windows Version 10.0.16299.19 is apparently the Fall Creator's Update which just landed this week, maybe that's also related. Setting up a VM to recreate this myself.
@blowdart i think the next step would be a procmon dump of the spawned git process - let me write up some steps of the processes I want to inspect so i can compare my setup versus yours.
@blowdart so if you leave procmon running and make it error again, filter on this git.exe process that initiates the clone, save the resulting events to a PML file or whatever, upload it somewhere (my log is ~50MB for that process) and link it to me (privately is fine) that should give me more to work with.
it seems to be failing as it's doing the initial checkout
Resolving deltas: 96% (101/105)
Resolving deltas: 98% (103/105)
Resolving deltas: 99% (104/105)
Resolving deltas: 100% (105/105)
Resolving deltas: 100% (105/105), done.
1 [main] sh (2072) C:\Users\bdorrans\AppData\Local\GitHubDesktop\app-1.0.4\resources\app\git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x2E07408/0x2EC7408.
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.
0 [main] sh 8736 fork: child -1 - forked process 2072 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
sh.exe is being spawned to perform these commands in a successful clone:
> sh C:\Users\shiftkey\AppData\Local\GitHubDesktop\app-1.0.4\resources\app\git\mingw64\libexec\git-core\git-submodule update --init --recursive --progress
> sh C:\Users\shiftkey\AppData\Local\GitHubDesktop\app-1.0.4\resources\app\git\mingw64\libexec\git-core\git-submodule foreach --recursive "git lfs pull"
The first command is because we pass --recursivewhen cloning, and the second command comes from Git LFS.
@blowdart yeah, I'm happy to work with you to get to the bottom of this, as it's an obscure bug and the root cause is deep in the bowels of the things that Git for Windows builds upon.
Those cygheap problems typically occur when there are multiple, different msys-2.0.dllfiles in use in the call path (the technical reasons are a bit complicated, and I write this on a phone).
It says cygwin1.dll because nobody fixed that in the MSYS2 runtime yet.
The curious thing is: why is a Shell spawned by the checkout in the first place? Are there hooks in play? Or clean/smudge filters?
Reacted by Zingus J. Rinkle, Julien Bérubé, Semih Kurt and Orestis Ousoultzoglou
Alright, I think we know the root cause of this issue, and as @dscho mentions making MSYS2 work with ASLR is not feasible currently due to significant technical reasons. So I'm going to close this out and refer to it later for those who happen to stumble upon this in the future.
I found a "fix". Add an exclusion for each program that crashes with that message until it works as desired. Example for git add -p with perl excluded:
with sh and perl excluded:
Just add more until it works :D
Reacted by Egor Laufer, Drew Gottlieb, Quitch and Julian Knight
You will have to add each and every .exe in <Git>\usr\bin, as all of them link to msys-2.0.dll, and it is that msys-2.0.dll whose initialization causes problems with ASLR.
Reacted by Julian Knight and Christopher J. Shaker
@blowdart Out of curiosity, I am no expert in any of the stuff,
I might be too late to comment on this, but thi might help someone having similar issue.
I see that you are using 32 bit Git install and have a 64 bit system. Github Desktop app is using 64 bit dlls. Have you tried with 64 Bit Git binaries? I had the same issue which vanished after installing 64 Bit binaries. .\rebase.exe -i msys-2.0.dll gives the same values for all the dlls.
Earlier I was using 32 Bit Git binaries and I could not commit or do anything in Atom / Github desktop as the action would simply fail with heap mismatch error for cygwin1.dl. After changing to 64 bit all of them use same base so it works fine i guess??. I do not remember what the values were for 32 bit. I have tested with powershell, Atom, VSCode, and the Github desktop app and it works fine.
I guess somewhere it tries to load sh.exe from your git install and the one bundled with atom/Github desktop & that is the cause for the problem.
This problem suddenly appeared on my system as well today. I think Windows automatically installed the March (2018) Cumulative Update for Windows 10 (1709) overnight....... and since then, this happens.
Going to check my options in this thread now.
Update: I uninstalled & deleted all files from GitHub Desktop and installed Git for Windows with poshgit.
I'd like to reiterate whatever everyone else mentioned about uninstalling/reinstalling. I'm using this and was starting to have issues in PHPStorm when doing stashes. I came across this in a Google search and was applicable to me.
In case anyone happens on this thread as I did. I was having problems issuing the git submodule add ... command, nothing to do with GitHub Desktop.
The fix is, indeed to add each erroring executable to the Exploit Protection overrides. I added by exe name - e.g. uname.exe rather than path. I disabled the two ASLR settings - not sure if that was needed but it works.
Removing github Desktop completely and reinstalling had no effect.
As TotallyInformation said, I had to add the exploit protection overrides for every file in the Cygwin package used by Github. With these exploit protection overrides, Github Desktop now works for me again.
Attached is the XML file I exported from the Windows 10 Exploit Protection setup. Github_exploit_settings.txt
Activity
shiftkey commentedon Oct 18, 2017
I talked with @blowdart a bit on Twitter and he mentioned that a clone in Visual Studio 15.4.0 also fails (let's assume it's the same way), but a clone with the full Git for Windows works fine.
This might mean it's related to MinGit and how it's generated. Windows Version
10.0.16299.19is apparently the Fall Creator's Update which just landed this week, maybe that's also related. Setting up a VM to recreate this myself.blowdart commentedon Oct 18, 2017
Sync works just fine, certainly within VS.
shiftkey commentedon Oct 18, 2017
A fresh Windows 10 VM updated to Fall Creator's Update and then cloning a repository worked for me.
So I'm all...
blowdart commentedon Oct 18, 2017
I can't believe you just "Worked on my machine" me 🗡
More seriously, how do I help figure out what's making it barf?
shiftkey commentedon Oct 18, 2017
@blowdart i think the next step would be a
procmondump of the spawned git process - let me write up some steps of the processes I want to inspect so i can compare my setup versus yours.shiftkey commentedon Oct 18, 2017
@blowdart so if you leave
procmonrunning and make it error again, filter on thisgit.exeprocess that initiates the clone, save the resulting events to a PML file or whatever, upload it somewhere (my log is ~50MB for that process) and link it to me (privately is fine) that should give me more to work with.shiftkey commentedon Oct 18, 2017
Some extra notes:
sh.exeis being spawned to perform these commands in a successful clone:The first command is because we pass
--recursivewhen cloning, and the second command comes from Git LFS.shiftkey commentedon Oct 19, 2017
The version of Git in Desktop is 64-bit, not sure about VS because I haven't got around to installing it, but this might be a clue.
@blowdart what happens if you clone from PoSH and pass in
--recursivewhen cloning? Do you get the same error then?blowdart commentedon Oct 19, 2017
It's only my work desktop (of course), so I'll try to repro in the morning. Obviously I'd much rather not rebuild that desktop :)
Home desktop has git version 2.14.1.windows.1 as the standalone install, and it's old Github Desktop 3.3.40. I'm going to leave that alone for now.
shiftkey commentedon Oct 19, 2017
@blowdart yeah, I'm happy to work with you to get to the bottom of this, as it's an obscure bug and the root cause is deep in the bowels of the things that Git for Windows builds upon.
blowdart commentedon Oct 19, 2017
I did try the 64 bit version of git standalone too, to no avail.
dscho commentedon Oct 19, 2017
Those cygheap problems typically occur when there are multiple, different
msys-2.0.dllfiles in use in the call path (the technical reasons are a bit complicated, and I write this on a phone).It says
cygwin1.dllbecause nobody fixed that in the MSYS2 runtime yet.The curious thing is: why is a Shell spawned by the checkout in the first place? Are there hooks in play? Or clean/smudge filters?
shiftkey commentedon Oct 19, 2017
@dscho
Looking at procmon the first invocation of
shisI think it's this command which is run only if the
post-checkouthook succeeds so maybe the checkout has worked fine - I'm pretty surecheckoutdoesn't report progress to stdout, which might explain why it's not in the log.The global
~/.gitconfigshould only have Git LFS smudge/clean filters. @blowdart can confirm.dscho commentedon Oct 19, 2017
But of course,
git-submoduleis still implemented as a Shell script :-(18 remaining items
shiftkey commentedon Oct 25, 2017
Alright, I think we know the root cause of this issue, and as @dscho mentions making MSYS2 work with ASLR is not feasible currently due to significant technical reasons. So I'm going to close this out and refer to it later for those who happen to stumble upon this in the future.
Thanks @blowdart @sylveon and of course @dscho for helping dig into it!
sylveon commentedon Oct 25, 2017
I found a "fix". Add an exclusion for each program that crashes with that message until it works as desired. Example for


git add -pwith perl excluded:with sh and perl excluded:
Just add more until it works :D
dscho commentedon Oct 27, 2017
You will have to add each and every
.exein<Git>\usr\bin, as all of them link tomsys-2.0.dll, and it is thatmsys-2.0.dllwhose initialization causes problems with ASLR.sylveon commentedon Oct 27, 2017
As long as you don't hit a codepath that calls
fork()you're fine without adding an exception.tprasadtp commentedon Feb 18, 2018
@blowdart Out of curiosity, I am no expert in any of the stuff,
I might be too late to comment on this, but thi might help someone having similar issue.
I see that you are using 32 bit Git install and have a 64 bit system. Github Desktop app is using 64 bit dlls. Have you tried with 64 Bit Git binaries? I had the same issue which vanished after installing 64 Bit binaries.
.\rebase.exe -i msys-2.0.dllgives the same values for all the dlls.Earlier I was using 32 Bit Git binaries and I could not commit or do anything in Atom / Github desktop as the action would simply fail with heap mismatch error for cygwin1.dl. After changing to 64 bit all of them use same base so it works fine i guess??. I do not remember what the values were for 32 bit. I have tested with powershell, Atom, VSCode, and the Github desktop app and it works fine.
I guess somewhere it tries to load sh.exe from your git install and the one bundled with atom/Github desktop & that is the cause for the problem.
cogmind commentedon Mar 8, 2018
This problem suddenly appeared on my system. Uninstalling GitHub Desktop and reinstalling the latest version of the desktop client solved the problem.
patrikhuber commentedon Mar 15, 2018
This problem suddenly appeared on my system as well today. I think Windows automatically installed the March (2018) Cumulative Update for Windows 10 (1709) overnight....... and since then, this happens.
Going to check my options in this thread now.
Update: I uninstalled & deleted all files from GitHub Desktop and installed Git for Windows with poshgit.
Erutan409 commentedon Apr 13, 2018
I'd like to reiterate whatever everyone else mentioned about uninstalling/reinstalling. I'm using this and was starting to have issues in PHPStorm when doing stashes. I came across this in a Google search and was applicable to me.
Thanks!
TotallyInformation commentedon Dec 2, 2018
In case anyone happens on this thread as I did. I was having problems issuing the
git submodule add ...command, nothing to do with GitHub Desktop.The fix is, indeed to add each erroring executable to the Exploit Protection overrides. I added by exe name - e.g.
uname.exerather than path. I disabled the two ASLR settings - not sure if that was needed but it works.https://superuser.com/questions/1380238/how-can-i-fix-the-error-fatal-error-cygheap-base-mismatch-detected-when-usin
cjshaker commentedon Sep 7, 2019
Removing github Desktop completely and reinstalling had no effect.
As TotallyInformation said, I had to add the exploit protection overrides for every file in the Cygwin package used by Github. With these exploit protection overrides, Github Desktop now works for me again.
Attached is the XML file I exported from the Windows 10 Exploit Protection setup.
Github_exploit_settings.txt
Chris Shaker