Use cygwin executable in git bash script
I have a .sh
script that I double-click to have it executed by git for Windows.
Now I need (imagemagick) convert
from cygwin (which I have installed) and I'm calling it with its absolute path - /c/cygwin64/bin/convert.exe
- but I get:
fatal error - cygheap base mismatch detected.
This problem is probably due to using incompatible versions of the cygwin DLL.
Wrapping the actual convert
call in a cygwin bash call, or even in a cmd.exe
call, doesn't help. This is a bit strange because I sometimes use cygwin executables directly in .cmd
scripts, and that always worked.
What can I do? A solution that keeps my program limited to one file would be preferred.
(I know I could probably just install Windows-native imagemagick. But then the next day I need another cygwin tool in a git-for-Win-Shellscript .. also, I'd like to understand what's happening here. And, yes, I will probably make git for Windows obsolete in my workplace, if possible)
windows bash git cygwin
|
show 1 more comment
I have a .sh
script that I double-click to have it executed by git for Windows.
Now I need (imagemagick) convert
from cygwin (which I have installed) and I'm calling it with its absolute path - /c/cygwin64/bin/convert.exe
- but I get:
fatal error - cygheap base mismatch detected.
This problem is probably due to using incompatible versions of the cygwin DLL.
Wrapping the actual convert
call in a cygwin bash call, or even in a cmd.exe
call, doesn't help. This is a bit strange because I sometimes use cygwin executables directly in .cmd
scripts, and that always worked.
What can I do? A solution that keeps my program limited to one file would be preferred.
(I know I could probably just install Windows-native imagemagick. But then the next day I need another cygwin tool in a git-for-Win-Shellscript .. also, I'd like to understand what's happening here. And, yes, I will probably make git for Windows obsolete in my workplace, if possible)
windows bash git cygwin
Don't mix and match different products based on Cygwin. Use Cygwin git instead.
– DavidPostill♦
Feb 12 '17 at 10:08
Thanks for your comment. It wasn't obvious to me that git for Windows is based on cygwin. I continuously read "MinGW" .. "MSYS" etc. which doesn't sound so much like cygwin. But just for curiosity: what other products are based on cygwin?
– SomeDev
Feb 12 '17 at 10:45
And am I right that the UnxUtils / GnuWin32 Tools are Windows-native? Is it true that Microsoft is working on some sort of "Linux-like environment" in Windows (including a bash and maybe other fine things)?
– SomeDev
Feb 12 '17 at 10:47
"It wasn't obvious to me that git for Windows is based on cygwin" I'm guessing based on the dll error message. Can you check if you have multiple copes of the cygwin dll on your system?
– DavidPostill♦
Feb 12 '17 at 10:52
Windows 10 Anniversary Edition introduced a new feature called Windows Subsystem for Linux. It includes bash. I'm not running Windows 10 so I don't know what else it includes.
– DavidPostill♦
Feb 12 '17 at 10:53
|
show 1 more comment
I have a .sh
script that I double-click to have it executed by git for Windows.
Now I need (imagemagick) convert
from cygwin (which I have installed) and I'm calling it with its absolute path - /c/cygwin64/bin/convert.exe
- but I get:
fatal error - cygheap base mismatch detected.
This problem is probably due to using incompatible versions of the cygwin DLL.
Wrapping the actual convert
call in a cygwin bash call, or even in a cmd.exe
call, doesn't help. This is a bit strange because I sometimes use cygwin executables directly in .cmd
scripts, and that always worked.
What can I do? A solution that keeps my program limited to one file would be preferred.
(I know I could probably just install Windows-native imagemagick. But then the next day I need another cygwin tool in a git-for-Win-Shellscript .. also, I'd like to understand what's happening here. And, yes, I will probably make git for Windows obsolete in my workplace, if possible)
windows bash git cygwin
I have a .sh
script that I double-click to have it executed by git for Windows.
Now I need (imagemagick) convert
from cygwin (which I have installed) and I'm calling it with its absolute path - /c/cygwin64/bin/convert.exe
- but I get:
fatal error - cygheap base mismatch detected.
This problem is probably due to using incompatible versions of the cygwin DLL.
Wrapping the actual convert
call in a cygwin bash call, or even in a cmd.exe
call, doesn't help. This is a bit strange because I sometimes use cygwin executables directly in .cmd
scripts, and that always worked.
What can I do? A solution that keeps my program limited to one file would be preferred.
(I know I could probably just install Windows-native imagemagick. But then the next day I need another cygwin tool in a git-for-Win-Shellscript .. also, I'd like to understand what's happening here. And, yes, I will probably make git for Windows obsolete in my workplace, if possible)
windows bash git cygwin
windows bash git cygwin
edited Mar 20 '17 at 10:17
Community♦
1
1
asked Feb 12 '17 at 9:52
SomeDev
4625
4625
Don't mix and match different products based on Cygwin. Use Cygwin git instead.
– DavidPostill♦
Feb 12 '17 at 10:08
Thanks for your comment. It wasn't obvious to me that git for Windows is based on cygwin. I continuously read "MinGW" .. "MSYS" etc. which doesn't sound so much like cygwin. But just for curiosity: what other products are based on cygwin?
– SomeDev
Feb 12 '17 at 10:45
And am I right that the UnxUtils / GnuWin32 Tools are Windows-native? Is it true that Microsoft is working on some sort of "Linux-like environment" in Windows (including a bash and maybe other fine things)?
– SomeDev
Feb 12 '17 at 10:47
"It wasn't obvious to me that git for Windows is based on cygwin" I'm guessing based on the dll error message. Can you check if you have multiple copes of the cygwin dll on your system?
– DavidPostill♦
Feb 12 '17 at 10:52
Windows 10 Anniversary Edition introduced a new feature called Windows Subsystem for Linux. It includes bash. I'm not running Windows 10 so I don't know what else it includes.
– DavidPostill♦
Feb 12 '17 at 10:53
|
show 1 more comment
Don't mix and match different products based on Cygwin. Use Cygwin git instead.
– DavidPostill♦
Feb 12 '17 at 10:08
Thanks for your comment. It wasn't obvious to me that git for Windows is based on cygwin. I continuously read "MinGW" .. "MSYS" etc. which doesn't sound so much like cygwin. But just for curiosity: what other products are based on cygwin?
– SomeDev
Feb 12 '17 at 10:45
And am I right that the UnxUtils / GnuWin32 Tools are Windows-native? Is it true that Microsoft is working on some sort of "Linux-like environment" in Windows (including a bash and maybe other fine things)?
– SomeDev
Feb 12 '17 at 10:47
"It wasn't obvious to me that git for Windows is based on cygwin" I'm guessing based on the dll error message. Can you check if you have multiple copes of the cygwin dll on your system?
– DavidPostill♦
Feb 12 '17 at 10:52
Windows 10 Anniversary Edition introduced a new feature called Windows Subsystem for Linux. It includes bash. I'm not running Windows 10 so I don't know what else it includes.
– DavidPostill♦
Feb 12 '17 at 10:53
Don't mix and match different products based on Cygwin. Use Cygwin git instead.
– DavidPostill♦
Feb 12 '17 at 10:08
Don't mix and match different products based on Cygwin. Use Cygwin git instead.
– DavidPostill♦
Feb 12 '17 at 10:08
Thanks for your comment. It wasn't obvious to me that git for Windows is based on cygwin. I continuously read "MinGW" .. "MSYS" etc. which doesn't sound so much like cygwin. But just for curiosity: what other products are based on cygwin?
– SomeDev
Feb 12 '17 at 10:45
Thanks for your comment. It wasn't obvious to me that git for Windows is based on cygwin. I continuously read "MinGW" .. "MSYS" etc. which doesn't sound so much like cygwin. But just for curiosity: what other products are based on cygwin?
– SomeDev
Feb 12 '17 at 10:45
And am I right that the UnxUtils / GnuWin32 Tools are Windows-native? Is it true that Microsoft is working on some sort of "Linux-like environment" in Windows (including a bash and maybe other fine things)?
– SomeDev
Feb 12 '17 at 10:47
And am I right that the UnxUtils / GnuWin32 Tools are Windows-native? Is it true that Microsoft is working on some sort of "Linux-like environment" in Windows (including a bash and maybe other fine things)?
– SomeDev
Feb 12 '17 at 10:47
"It wasn't obvious to me that git for Windows is based on cygwin" I'm guessing based on the dll error message. Can you check if you have multiple copes of the cygwin dll on your system?
– DavidPostill♦
Feb 12 '17 at 10:52
"It wasn't obvious to me that git for Windows is based on cygwin" I'm guessing based on the dll error message. Can you check if you have multiple copes of the cygwin dll on your system?
– DavidPostill♦
Feb 12 '17 at 10:52
Windows 10 Anniversary Edition introduced a new feature called Windows Subsystem for Linux. It includes bash. I'm not running Windows 10 so I don't know what else it includes.
– DavidPostill♦
Feb 12 '17 at 10:53
Windows 10 Anniversary Edition introduced a new feature called Windows Subsystem for Linux. It includes bash. I'm not running Windows 10 so I don't know what else it includes.
– DavidPostill♦
Feb 12 '17 at 10:53
|
show 1 more comment
1 Answer
1
active
oldest
votes
fatal error - cygheap base mismatch detected.
This problem is probably due to using incompatible versions of the cygwin DLL.
This error is caused because the Git for Windows path is incompatible with Cywin.
They both use
/bin
and/usr/bin
but these map to different directories (because they use different mount tables).Cywin expects to find the dll in
/usr/bin/cygwin1.dll
(and is not found in Git for Windows)When you explicitly run any Cygwin command in a Git for Windows
bash
shell Cygwin cannot find its dll and generates the error message above.Notice below that the mount mapping for
/
is different.
Git for Windows:
DavidPostill@Hal MINGW64 ~
$ mount
C:/temp on /tmp type ntfs (binary,noacl,posix=0,usertemp)
C:/apps/Git on / type ntfs (binary,noacl,auto)
C:/apps/Git/usr/bin on /bin type ntfs (binary,noacl,auto)
C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto)
E: on /e type vfat (binary,noacl,posix=0,user,noumount,auto)
F: on /f type ntfs (binary,noacl,posix=0,user,noumount,auto)
DavidPostill@Hal MINGW64 ~
$ which cygwin1.dll
which: no cygwin1.dll in (/c/Users/DavidPostill/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/DavidPostill/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/apps/WSCC/Sysinternals Suite:/c/apps/WSCC/NirSoft Utilities:/c/apps/Calibre:/cmd:/mingw64/bin:/usr/bin:/usr/bin/vendor_perl:/usr/bin/core_perl)
DavidPostill@Hal MINGW64 ~
$ /c/cygwin/bin/man
1 [main] man (608) C:cygwinbinman.exe: *** fatal error - cygheap base mismatch detected - 0x180301408/0x180304408.
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:cygwinbin, 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.
Segmentation fault
Cygwin:
$ mount
C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin on / type ntfs (binary,auto)
C: on /c type ntfs (binary,posix=0,user,noumount,auto)
E: on /e type vfat (binary,posix=0,user,noumount,auto)
F: on /f type ntfs (binary,posix=0,user,noumount,auto)
$ which cygwin1.dll
/usr/bin/cygwin1.dll
$ /c/cygwin/bin/man
What manual page do you want?
There is no solution, other than don't mix and match cygwin derived utilities. Pick one and stick with it.
1
Thanks for the explanation. How about a solution?
– Jim G.
Mar 15 at 8:28
2
@JimG. There isn't one, other than don't mix and match cygwin derived utilities. Pick one and stick with it.
– DavidPostill♦
Mar 15 at 8:40
Not helpful as there are no pointers to help with a solution. This is occuring for many people who don't have the knowledge to work out what caused it.
– Julian Knight
Dec 2 at 16:44
@JulianKnight See my previous comment. I've updated the answer.
– DavidPostill♦
Dec 2 at 16:51
Unfortunately, I am now getting this with everything associated with git. I've installed new versions but I'm not using cygwin explicitly, just git. I can't even start the git cmd line. So I can't track down what is causing the issue and fix it. Still working through this to see if it helps: github.com/desktop/desktop/issues/3096
– Julian Knight
Dec 2 at 17:27
|
show 2 more comments
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1177972%2fuse-cygwin-executable-in-git-bash-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
fatal error - cygheap base mismatch detected.
This problem is probably due to using incompatible versions of the cygwin DLL.
This error is caused because the Git for Windows path is incompatible with Cywin.
They both use
/bin
and/usr/bin
but these map to different directories (because they use different mount tables).Cywin expects to find the dll in
/usr/bin/cygwin1.dll
(and is not found in Git for Windows)When you explicitly run any Cygwin command in a Git for Windows
bash
shell Cygwin cannot find its dll and generates the error message above.Notice below that the mount mapping for
/
is different.
Git for Windows:
DavidPostill@Hal MINGW64 ~
$ mount
C:/temp on /tmp type ntfs (binary,noacl,posix=0,usertemp)
C:/apps/Git on / type ntfs (binary,noacl,auto)
C:/apps/Git/usr/bin on /bin type ntfs (binary,noacl,auto)
C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto)
E: on /e type vfat (binary,noacl,posix=0,user,noumount,auto)
F: on /f type ntfs (binary,noacl,posix=0,user,noumount,auto)
DavidPostill@Hal MINGW64 ~
$ which cygwin1.dll
which: no cygwin1.dll in (/c/Users/DavidPostill/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/DavidPostill/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/apps/WSCC/Sysinternals Suite:/c/apps/WSCC/NirSoft Utilities:/c/apps/Calibre:/cmd:/mingw64/bin:/usr/bin:/usr/bin/vendor_perl:/usr/bin/core_perl)
DavidPostill@Hal MINGW64 ~
$ /c/cygwin/bin/man
1 [main] man (608) C:cygwinbinman.exe: *** fatal error - cygheap base mismatch detected - 0x180301408/0x180304408.
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:cygwinbin, 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.
Segmentation fault
Cygwin:
$ mount
C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin on / type ntfs (binary,auto)
C: on /c type ntfs (binary,posix=0,user,noumount,auto)
E: on /e type vfat (binary,posix=0,user,noumount,auto)
F: on /f type ntfs (binary,posix=0,user,noumount,auto)
$ which cygwin1.dll
/usr/bin/cygwin1.dll
$ /c/cygwin/bin/man
What manual page do you want?
There is no solution, other than don't mix and match cygwin derived utilities. Pick one and stick with it.
1
Thanks for the explanation. How about a solution?
– Jim G.
Mar 15 at 8:28
2
@JimG. There isn't one, other than don't mix and match cygwin derived utilities. Pick one and stick with it.
– DavidPostill♦
Mar 15 at 8:40
Not helpful as there are no pointers to help with a solution. This is occuring for many people who don't have the knowledge to work out what caused it.
– Julian Knight
Dec 2 at 16:44
@JulianKnight See my previous comment. I've updated the answer.
– DavidPostill♦
Dec 2 at 16:51
Unfortunately, I am now getting this with everything associated with git. I've installed new versions but I'm not using cygwin explicitly, just git. I can't even start the git cmd line. So I can't track down what is causing the issue and fix it. Still working through this to see if it helps: github.com/desktop/desktop/issues/3096
– Julian Knight
Dec 2 at 17:27
|
show 2 more comments
fatal error - cygheap base mismatch detected.
This problem is probably due to using incompatible versions of the cygwin DLL.
This error is caused because the Git for Windows path is incompatible with Cywin.
They both use
/bin
and/usr/bin
but these map to different directories (because they use different mount tables).Cywin expects to find the dll in
/usr/bin/cygwin1.dll
(and is not found in Git for Windows)When you explicitly run any Cygwin command in a Git for Windows
bash
shell Cygwin cannot find its dll and generates the error message above.Notice below that the mount mapping for
/
is different.
Git for Windows:
DavidPostill@Hal MINGW64 ~
$ mount
C:/temp on /tmp type ntfs (binary,noacl,posix=0,usertemp)
C:/apps/Git on / type ntfs (binary,noacl,auto)
C:/apps/Git/usr/bin on /bin type ntfs (binary,noacl,auto)
C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto)
E: on /e type vfat (binary,noacl,posix=0,user,noumount,auto)
F: on /f type ntfs (binary,noacl,posix=0,user,noumount,auto)
DavidPostill@Hal MINGW64 ~
$ which cygwin1.dll
which: no cygwin1.dll in (/c/Users/DavidPostill/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/DavidPostill/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/apps/WSCC/Sysinternals Suite:/c/apps/WSCC/NirSoft Utilities:/c/apps/Calibre:/cmd:/mingw64/bin:/usr/bin:/usr/bin/vendor_perl:/usr/bin/core_perl)
DavidPostill@Hal MINGW64 ~
$ /c/cygwin/bin/man
1 [main] man (608) C:cygwinbinman.exe: *** fatal error - cygheap base mismatch detected - 0x180301408/0x180304408.
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:cygwinbin, 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.
Segmentation fault
Cygwin:
$ mount
C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin on / type ntfs (binary,auto)
C: on /c type ntfs (binary,posix=0,user,noumount,auto)
E: on /e type vfat (binary,posix=0,user,noumount,auto)
F: on /f type ntfs (binary,posix=0,user,noumount,auto)
$ which cygwin1.dll
/usr/bin/cygwin1.dll
$ /c/cygwin/bin/man
What manual page do you want?
There is no solution, other than don't mix and match cygwin derived utilities. Pick one and stick with it.
1
Thanks for the explanation. How about a solution?
– Jim G.
Mar 15 at 8:28
2
@JimG. There isn't one, other than don't mix and match cygwin derived utilities. Pick one and stick with it.
– DavidPostill♦
Mar 15 at 8:40
Not helpful as there are no pointers to help with a solution. This is occuring for many people who don't have the knowledge to work out what caused it.
– Julian Knight
Dec 2 at 16:44
@JulianKnight See my previous comment. I've updated the answer.
– DavidPostill♦
Dec 2 at 16:51
Unfortunately, I am now getting this with everything associated with git. I've installed new versions but I'm not using cygwin explicitly, just git. I can't even start the git cmd line. So I can't track down what is causing the issue and fix it. Still working through this to see if it helps: github.com/desktop/desktop/issues/3096
– Julian Knight
Dec 2 at 17:27
|
show 2 more comments
fatal error - cygheap base mismatch detected.
This problem is probably due to using incompatible versions of the cygwin DLL.
This error is caused because the Git for Windows path is incompatible with Cywin.
They both use
/bin
and/usr/bin
but these map to different directories (because they use different mount tables).Cywin expects to find the dll in
/usr/bin/cygwin1.dll
(and is not found in Git for Windows)When you explicitly run any Cygwin command in a Git for Windows
bash
shell Cygwin cannot find its dll and generates the error message above.Notice below that the mount mapping for
/
is different.
Git for Windows:
DavidPostill@Hal MINGW64 ~
$ mount
C:/temp on /tmp type ntfs (binary,noacl,posix=0,usertemp)
C:/apps/Git on / type ntfs (binary,noacl,auto)
C:/apps/Git/usr/bin on /bin type ntfs (binary,noacl,auto)
C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto)
E: on /e type vfat (binary,noacl,posix=0,user,noumount,auto)
F: on /f type ntfs (binary,noacl,posix=0,user,noumount,auto)
DavidPostill@Hal MINGW64 ~
$ which cygwin1.dll
which: no cygwin1.dll in (/c/Users/DavidPostill/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/DavidPostill/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/apps/WSCC/Sysinternals Suite:/c/apps/WSCC/NirSoft Utilities:/c/apps/Calibre:/cmd:/mingw64/bin:/usr/bin:/usr/bin/vendor_perl:/usr/bin/core_perl)
DavidPostill@Hal MINGW64 ~
$ /c/cygwin/bin/man
1 [main] man (608) C:cygwinbinman.exe: *** fatal error - cygheap base mismatch detected - 0x180301408/0x180304408.
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:cygwinbin, 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.
Segmentation fault
Cygwin:
$ mount
C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin on / type ntfs (binary,auto)
C: on /c type ntfs (binary,posix=0,user,noumount,auto)
E: on /e type vfat (binary,posix=0,user,noumount,auto)
F: on /f type ntfs (binary,posix=0,user,noumount,auto)
$ which cygwin1.dll
/usr/bin/cygwin1.dll
$ /c/cygwin/bin/man
What manual page do you want?
There is no solution, other than don't mix and match cygwin derived utilities. Pick one and stick with it.
fatal error - cygheap base mismatch detected.
This problem is probably due to using incompatible versions of the cygwin DLL.
This error is caused because the Git for Windows path is incompatible with Cywin.
They both use
/bin
and/usr/bin
but these map to different directories (because they use different mount tables).Cywin expects to find the dll in
/usr/bin/cygwin1.dll
(and is not found in Git for Windows)When you explicitly run any Cygwin command in a Git for Windows
bash
shell Cygwin cannot find its dll and generates the error message above.Notice below that the mount mapping for
/
is different.
Git for Windows:
DavidPostill@Hal MINGW64 ~
$ mount
C:/temp on /tmp type ntfs (binary,noacl,posix=0,usertemp)
C:/apps/Git on / type ntfs (binary,noacl,auto)
C:/apps/Git/usr/bin on /bin type ntfs (binary,noacl,auto)
C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto)
E: on /e type vfat (binary,noacl,posix=0,user,noumount,auto)
F: on /f type ntfs (binary,noacl,posix=0,user,noumount,auto)
DavidPostill@Hal MINGW64 ~
$ which cygwin1.dll
which: no cygwin1.dll in (/c/Users/DavidPostill/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/DavidPostill/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/apps/WSCC/Sysinternals Suite:/c/apps/WSCC/NirSoft Utilities:/c/apps/Calibre:/cmd:/mingw64/bin:/usr/bin:/usr/bin/vendor_perl:/usr/bin/core_perl)
DavidPostill@Hal MINGW64 ~
$ /c/cygwin/bin/man
1 [main] man (608) C:cygwinbinman.exe: *** fatal error - cygheap base mismatch detected - 0x180301408/0x180304408.
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:cygwinbin, 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.
Segmentation fault
Cygwin:
$ mount
C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin on / type ntfs (binary,auto)
C: on /c type ntfs (binary,posix=0,user,noumount,auto)
E: on /e type vfat (binary,posix=0,user,noumount,auto)
F: on /f type ntfs (binary,posix=0,user,noumount,auto)
$ which cygwin1.dll
/usr/bin/cygwin1.dll
$ /c/cygwin/bin/man
What manual page do you want?
There is no solution, other than don't mix and match cygwin derived utilities. Pick one and stick with it.
edited Dec 2 at 16:52
answered Feb 12 '17 at 18:36
DavidPostill♦
103k25222256
103k25222256
1
Thanks for the explanation. How about a solution?
– Jim G.
Mar 15 at 8:28
2
@JimG. There isn't one, other than don't mix and match cygwin derived utilities. Pick one and stick with it.
– DavidPostill♦
Mar 15 at 8:40
Not helpful as there are no pointers to help with a solution. This is occuring for many people who don't have the knowledge to work out what caused it.
– Julian Knight
Dec 2 at 16:44
@JulianKnight See my previous comment. I've updated the answer.
– DavidPostill♦
Dec 2 at 16:51
Unfortunately, I am now getting this with everything associated with git. I've installed new versions but I'm not using cygwin explicitly, just git. I can't even start the git cmd line. So I can't track down what is causing the issue and fix it. Still working through this to see if it helps: github.com/desktop/desktop/issues/3096
– Julian Knight
Dec 2 at 17:27
|
show 2 more comments
1
Thanks for the explanation. How about a solution?
– Jim G.
Mar 15 at 8:28
2
@JimG. There isn't one, other than don't mix and match cygwin derived utilities. Pick one and stick with it.
– DavidPostill♦
Mar 15 at 8:40
Not helpful as there are no pointers to help with a solution. This is occuring for many people who don't have the knowledge to work out what caused it.
– Julian Knight
Dec 2 at 16:44
@JulianKnight See my previous comment. I've updated the answer.
– DavidPostill♦
Dec 2 at 16:51
Unfortunately, I am now getting this with everything associated with git. I've installed new versions but I'm not using cygwin explicitly, just git. I can't even start the git cmd line. So I can't track down what is causing the issue and fix it. Still working through this to see if it helps: github.com/desktop/desktop/issues/3096
– Julian Knight
Dec 2 at 17:27
1
1
Thanks for the explanation. How about a solution?
– Jim G.
Mar 15 at 8:28
Thanks for the explanation. How about a solution?
– Jim G.
Mar 15 at 8:28
2
2
@JimG. There isn't one, other than don't mix and match cygwin derived utilities. Pick one and stick with it.
– DavidPostill♦
Mar 15 at 8:40
@JimG. There isn't one, other than don't mix and match cygwin derived utilities. Pick one and stick with it.
– DavidPostill♦
Mar 15 at 8:40
Not helpful as there are no pointers to help with a solution. This is occuring for many people who don't have the knowledge to work out what caused it.
– Julian Knight
Dec 2 at 16:44
Not helpful as there are no pointers to help with a solution. This is occuring for many people who don't have the knowledge to work out what caused it.
– Julian Knight
Dec 2 at 16:44
@JulianKnight See my previous comment. I've updated the answer.
– DavidPostill♦
Dec 2 at 16:51
@JulianKnight See my previous comment. I've updated the answer.
– DavidPostill♦
Dec 2 at 16:51
Unfortunately, I am now getting this with everything associated with git. I've installed new versions but I'm not using cygwin explicitly, just git. I can't even start the git cmd line. So I can't track down what is causing the issue and fix it. Still working through this to see if it helps: github.com/desktop/desktop/issues/3096
– Julian Knight
Dec 2 at 17:27
Unfortunately, I am now getting this with everything associated with git. I've installed new versions but I'm not using cygwin explicitly, just git. I can't even start the git cmd line. So I can't track down what is causing the issue and fix it. Still working through this to see if it helps: github.com/desktop/desktop/issues/3096
– Julian Knight
Dec 2 at 17:27
|
show 2 more comments
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1177972%2fuse-cygwin-executable-in-git-bash-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Don't mix and match different products based on Cygwin. Use Cygwin git instead.
– DavidPostill♦
Feb 12 '17 at 10:08
Thanks for your comment. It wasn't obvious to me that git for Windows is based on cygwin. I continuously read "MinGW" .. "MSYS" etc. which doesn't sound so much like cygwin. But just for curiosity: what other products are based on cygwin?
– SomeDev
Feb 12 '17 at 10:45
And am I right that the UnxUtils / GnuWin32 Tools are Windows-native? Is it true that Microsoft is working on some sort of "Linux-like environment" in Windows (including a bash and maybe other fine things)?
– SomeDev
Feb 12 '17 at 10:47
"It wasn't obvious to me that git for Windows is based on cygwin" I'm guessing based on the dll error message. Can you check if you have multiple copes of the cygwin dll on your system?
– DavidPostill♦
Feb 12 '17 at 10:52
Windows 10 Anniversary Edition introduced a new feature called Windows Subsystem for Linux. It includes bash. I'm not running Windows 10 so I don't know what else it includes.
– DavidPostill♦
Feb 12 '17 at 10:53