Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C:\Program Files\Git\usr\bin\scp.exe: *** fatal error - cygheap base mismatch detected #1373

Closed
garfieldbanks opened this issue Nov 22, 2017 · 7 comments

Comments

@garfieldbanks
Copy link

I don't have any cygwin installed other than what comes with Git-2.15.0-64-bit.exe.
Here is the command I tried:
scp file user@xxx.xxx.x.xxx:/path/to/file

This is the full error:

    1 [main] scp (9732) C:\Program Files\Git\usr\bin\scp.exe: *** fatal error - cygheap base mismatch detected - 0x3B57408/0x3517408.
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] scp 2736 fork: child -1 - forked process 9732 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
fork: Resource temporarily unavailable
@dscho
Copy link
Member

dscho commented Nov 25, 2017

Was this closed because the bug was resolved? If so, how was it resolved?

@garfieldbanks
Copy link
Author

garfieldbanks commented Nov 26, 2017

This is what caused it:
https://winaero.com/blog/beware-incorrectly-implements-aslr-windows-fix-available/
After removing MitigationOptions, I no longer had the issue.

@dscho
Copy link
Member

dscho commented Nov 26, 2017

Thanks! I do not quite understand how that bottom-up strategy fixes the problem, I would have expected it to exacerbate the problems. However, a reboot may have provided the workaround necessary to fix the Cygwin base address contention...

@garfieldbanks
Copy link
Author

garfieldbanks commented Nov 26, 2017

Yeah, I tried a bunch of things, including multiple reboots, before I remembered I had made this change earlier. I think I had to reboot after removing the registry key too.

@conioh
Copy link

conioh commented Dec 25, 2017

After removing MitigationOptions, I no longer had the issue.

@garfieldbanks If you deleted the MitigationOptions value it means you have disabled all of the mitigation options and are using the defaults. Specifically it means you have disabled Mandatory ASLR. Bottom-up is irrelevant for modules than aren't marked as ASLR-ready, which is all of the Git for Windows binaries, except git-bash.exe and its two buddies.

@dscho
Copy link
Member

dscho commented Jan 2, 2018

@conioh are you saying that mingw64\bin\git.exe is not marked ASLR-ready?

@conioh
Copy link

conioh commented Jan 2, 2018

@dscho:
No. I'm saying that usr\bin\hostname.exe isn't marked ASLR-ready and usr\bin\mv.exe isn't marked ASLR-ready and usr\bin\bash.exe isn't marked ASLR ready (though bin\bash.exe is).

The binary the issue referred to was C:\Program Files\Git\usr\bin\scp.exe and it is still not marked ASLR-ready. The fact that it works after OP deleted the MitigationOptions Registry value is not due to enabling bottom-up randomization but rather due to disabling Mandatory ASLR (and bottom-up randomization on the way).

You're correct I was inaccurate when I said that all Git for Windows binaries except 3 aren't marked ASLR-ready, but there are plenty of them to make the Git for Windows package (esp. "git bash" but not only) unusable without disabling Mandatory ASLR or adding exceptions. After adding manually 3 exceptions (starting with hostname.exe which was the first one to give me error after I enabled Mandatory ASLR) I got tired of checking them one by one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants