On Windows 10 build 10240 (RTM) x64 I installed Cygwin x64, which by default uses Mintty as the terminal emulator. This was working really well.
However, after recently updating to Windows 10 build 10586 via the official Windows Update method, Mintty fails to start.
/usr/bin/mintty: could not detach from caller Try '--help' for more information.'.A working Mintty =)
If further questions exist, just ask. I will be notified and will answer the questions.
You are using the current version of mintty?
Try mintty -d as a workaround, please.
How did you actually invoke mintty?
From shortcut, from Cygwin console, otherwise?
And can you check the current uploaded version?
Hi,
I invoked Mintty from the shortcut that Cygwin creates in my Start menu.
It runs this command:
C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico /bin/zsh --login
This is because I switched from Bash (the standard) to ZSH + Oh-my-ZSH, which I like much more.
Just for checking. I also reverted the shortcut back to it's original state, being:
C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico -
At this point I did some new discoveries. It turns out, that in both situations everything is working just fine, as long as I just launch via the start menu or directly via the shortcut.
I am however, using Launchy to be able to quickly start stuff by hitting alt-space, typing a few letters, and hitting enter. It now seems that the problem lies in using Launchy to start Cygwin, because that's the only way I am getting this detaching error...
However, no other program started showing problematic behaviour with Launchy after updating Win10 to build 10586, only Mintty. It might be therefor possible that this is somehow a thing where Mintty is unable to fork off Launchy, therefor declaring defeat and showing a notification.
I tried updating Mintty but it yesterday seemed that I was already running the latest version that is available for download. I will try your update to see if it makes any difference and let you know.
/edit
I tried adding -d to the Mintty command ends up with a window with black text on a red background saying Failed to fork child process: Resource temporarily unavailable. DLL rebasing may be required. See 'rebaseall --help'.
Can you please provide a link to the download page of the latest Mintty that I should try? I end up on Google Code but those versions are outdated as far as I can tell.
Failed to fork child process: Resource temporarily unavailable.
This is a volatile cygwin issue. The red notice is just from mintty to inform about some other problem.
Download is on https://github.com/mintty/mintty/ the button on the right "Download ZIP".
Ah, I thought you had a .exe ready but this means I have to compile it myself. Will try on GCC on Linux, hopefully that's the case and I don't need random stuff like Visual Studio lol
/edit
Building does not work, there is no ./configure and make states Makefile:51: *** Target 'x86_64-linux-gnu' not supported. Stop. so I'm out of luck.
??
Mintty runs and builds – out of the box – on cygwin (or on MSys) running on a Windows system.
There is no way (currently) to get it run on Linux and no need and no way either to build it with Visual Studio.
I also have this issue, but only when using launchy to invoke the cygwin shortcut. I've worked around it by binding a hotkey using AHKscript to launch cygwin instead, but it's hard to unlearn using launchy to spawn a terminal
Again, does it happen if you use the latest repository version (not the released, please compile from ZIP Download)?
What precisely are the error symptoms?
Okay, I've built mintty from source (git clone && make).
The console starts up now, but it gives an error instead of the prompt:

I had this exact issue. Running rebaseall from dash gave me a cygwin.dll conflict error. Trying the "-d" gave me the red screen above.
I updated cygwin several times, but every time the .sh postinstall scripts failed.
Then, I deleted /bin/cygwind-0.dll, and everything worked fine. I then updated cygwin again, and the postinstall scripts ran fine. I'm not sure what the cygwind-0.dll is for, but apparently it doesn't get reinstalled when updating cygwin, so maybe it was old.
No idea what that cygwind-0.dll is. Maybe you'd like to report it on the cygwin mailing list.
Quite obviously now, the remaining issue (forking problem, dependency to "rebasing") is not related to mintty.
The problem of mintty terminating too early in this situation has been fixed, the problem is now clearly reported. Issue to be closed after next release.
It was unclear to me what to do to 'build' MinTTY, but thanks to @albertxing I now understant it's nothing more than git clone && make.
Thanks everybody for the involvement, and @adipose especially for pointing out that removing cygwind-0.dll might solve this issue without the need for compiling MinTTY at all.
Will test both scenarios tonight if I get home from work (CET / GMT+1 here) and let you all know what scenario's solved it.
Actually git pull is overkill for just trying the current version. There is a Download ZIP button top right on the project page.
I know, but that does not provide me a working mintty.exe, but rather the contents of https://github.com/mintty/mintty/tree/master, which contains - after extraction - a Makefile, a src directory full of .c and .h files, etc. And to get from there to a mintty.exe, i would have to compile.
Neither does git clone provide mintty.exe. It's the same procedure - Download ZIP, unzip and make will do and not setup a git reference which you may not necessarily want.
@mintty Yeah, I suspected a cygwin/msys problem (I'm on MSYS2). I tried a /usr/bin/rebaseall but it gave me a segmentation fault ¯_(ツ)_/¯. Will try re-installing MSYS. Thanks!
@eXistenZNL Yes, doing a git clone isn't necessary. You can, as mintty suggested download a zip of the source files, extracting the zip archive, and in the extracted source directory run make.
Nope, reinstalling msys didn't solve the issue
Just compiled from the zip, installed mintty and this didn't fix it. Had to install gcc-core but that's easy with apt-cyg ofcourse.
Anyway, still having the same black text on red background error that @albertxing has, sadly. Also, searching for a cygwind-0.dll yields no results.
Tried to disable my antivirus (NOD32 AV v8) as well because it might be blocking random forks of programs, but that did not bring any results either.
So I understand that all impacted people are trying to start mintty via Launchy? Maybe that's a BLODA app?
As I cannot currently reproduce the problem, can someone run a cross-test please? Install rxvt (available on both cygwin and Msys) and try to run that the same way. What happens?
I was not using launchy. I was using hoekey, but that is irrelevant. When I double-clicked the shortcut to cygwin, it gave me the same error. I never had this issue before upgrading Windows 10.
As an aside, the cygwind-0.dll hadn't been modified since 2014, and I found it because when I tried to run rebaseall, it gave me that cygwin error that suggests searching for other cygwin.dlls.
https://gist.github.com/kanzure/6123756 shows some cases where cygwind-0.dll was once a dependency in cygwin.
I can't find anything in my dependencies today, or on a 6-month old version of cygwin.
See the discussion around https://cygwin.com/ml/cygwin/2015-12/msg00010.html which again confirms this is not a mintty issue.
Interesting. I have 32-bit cygwin, so I'm not sure that applies to me.
@mintty Thanks for the link.
I tried compiling my launcher program using x64 VS2015 and it solved the problem. So it confirms at least some issue with x64 cygwin/msys with x32 launchers.
There is a workaround in the test pre-release Cygwin 2.4.0-0.7, see https://cygwin.com/ml/cygwin/2015-12/msg00042.html, if you'd like to test that.
Testing now...
/edit
Cloned master, built, and tested it out.
It does not look like that there is a recent commits regarding the Windows 10 forking issue in the commit history https://github.com/mintty/mintty/commits/master (only 22 days ago) and I'm not sure if master is going to be 2.4.0-0.7 (and where 2.3 ended up if that's the case), but there are no other branches on Github so this is my best bet.
Anyway, I see no change. The current master branch still fails when starting Cygwin from Launchy, with the same error in black text on a red background as shown in the picture by @albertxing.
See my previous comment which points to Cygwin 2.4.0-0.7, not mintty.
See also my other previous comment; this is not a mintty issue and there's no fix in mintty.
It's actually a Windows issue (as described in the referred mail thread) but there's a workaround in the latest Cygwin test version. If you don't wish to install a test version, wait for the next Cygwin release please.
@eXistenZNL Another thing you can try is recompiling Launchy from source targeting x64 instead of x86; although I think using the Cygwin test build as @mintty suggested would be a better option.
Hi,
I just ran into this problem on a new Windows 10 system, using ObjectDock Plus. I'm pretty sure ObjectDock is a 32 bit application.
Is this specific to the cygwin 64 bit version? If I replace it with the 32 bit Cygwin, will that solve the problem for now?
According to previous comments, I guess so. You can also install both Cygwin versions at the same time.
Read the first entry of list of Bug Fixes (near bottom):
https://cygwin.com/ml/cygwin/2015-12/msg00273.html
This is for .15 of 2.4 Cygwin test version (though "fix" added to earlier 2.4 ( .7 test version I believe, as stated above.) Current test version is .16, and 2.4 should be released after start of new year. I just went ahead and installed this latest .16 via Setup, and mintty now launches via Launchy.
Something changed in W10 1511 in regards to how a 64 bit app forks off a 32 bit app. The above addresses this, and I am sure affects other 32 bit bit apps attempting to launch 64 bit mintty. Easy fix and Cygwin developers did a good job figuring it out and doing what needed to be done.
To be clear, just launch Setup, search for cygwin and click until gives 2.4 version. Does not appear you need to update cygwin-devel. Once 2.4 officially released, it should just update next time you run Setup if you are willing to wait.
This issue should be closed with today's release of Cygwin 2.4.0.
Although this ticket was closed, I just wanted to let you all know that the problem has indeed been fixed now that I updated Cygwin with the installer. Thanks all for the ride, glad this is over!
Thanks for the feedback.
Released the tweak (which isn't needed anymore...) in 2.2.3.
Hi eveyone just wondering I've downloaded the latest cygwin release x64 setup file, after install I get this on clicking the desktop application
"Failed to could not fork child process: No such file or directory."
Is this the same bug or differing one. should I be running a test version of cygwin?
Thanks
Please start a Cygwin Console (C:\cygwin64\Cygwin.bat).
What does uname -a say? What does mintty -V say?
Can you start mintty from there?
Copying skeleton files.
These files are for the users to personalise their cygwin experience.
They will never be overwritten nor automatically updated.
'./.bashrc' -> '/home/jason.engelsman//.bashrc'
/usr/bin/install: cannot create regular file '/home/jason.engelsman//.bashrc': Permission denied
'./.bash_profile' -> '/home/jason.engelsman//.bash_profile'
/usr/bin/install: cannot create regular file '/home/jason.engelsman//.bash_profile': Permission denied
'./.inputrc' -> '/home/jason.engelsman//.inputrc'
/usr/bin/install: cannot create regular file '/home/jason.engelsman//.inputrc': Permission denied
'./.profile' -> '/home/jason.engelsman//.profile'
/usr/bin/install: cannot create regular file '/home/jason.engelsman//.profile': Permission denied
Unknown+User@DESKTOP-KKGQS8K ~
$ uname -a
CYGWIN_NT-10.0 DESKTOP-KKGQS8K 2.4.1(0.293/5/3) 2016-01-24 11:26 x86_64 Cygwin
and
mintty version is 2.2.3 x86_64 pc_cygwin
Starting it from the command line opens a new console window with the same error.
"could not fork child process" is not the same situation as "could not detach from caller".
Anyway, I have improved error reporting in this situation, you may want to download and try the current version.
Likely this is a volatile resource problem as it sometimes occurs on cygwin. Have you rebooted after it first occurred? It may also help to call rebaseall.
Thanks I compiled your latest version and the new errror is
Error: could not fork child process: There are no available terminals.
Just mentioning I am running Win 10 and cygwin 64 bit.
... which confirms my suspicion you're having a local resource problem. Rebooted or rebased meanwhile?
Thanks again, I've rebooted multiple times, and I did a rebaseall. This is all post a new install of cygwin version 2.873.
What is version 2.873? The current cygwin version is 2.4.1, mintty is 2.2.3.
Sorry must have got confused, Thats the version the setup file shows You're right still on 2.4.1. My bad.
:+1: Installed on a clean Windows 10 Enterprise install today and I have the same problem. It's broken for Git Bash and Cygwin. If I run bash without mintty it works fine, but I'd like to have mintty if given the choice. This was a 64 bit version of Cygwin and a 64 bit version of Git Bash.
So you say you cannot start cygwin mintty? Which versions of cygwin and mintty are installed? (In Cygwin Console, run uname -a and mintty -V.) Can mintty be started from the cygwin console?
That is correct. It is on my machine in the office, so I will run those commands when I'm back in the office on Monday. It was a default install of cygwin64 that was available yesterday. Same for Git bash. mintty could not be started from the console (after I started bash manually for Cygwin).
Thanks!
For Cygwin:
Unknown+User@DESKTOP-LN2VG4M /usr/bin
$ /usr/bin/uname -a
CYGWIN_NT-10.0 DESKTOP-LN2VG4M 2.4.1(0.293/5/3) 2016-01-24 11:26 x86_64 Cygwin
and
mintty 2.2.3 (x86_64-pc-cygwin) (C) 2013/2016 Andy Koppe / Thomas Wolff
For Git Bash:
Unknown+User@DESKTOP-LN2VG4M MINGW64 /bin
$ uname -a
MINGW64_NT-10.0 DESKTOP-LN2VG4M 2.4.0(0.292/5/3) 2016-01-07 19:39 x86_64 Msys
and
mintty 2.0.3 (x86_64-pc-msys) (C) 2015 Andy Koppe
So, to get that clear: you click on the desktop shortcut for Cygwin Terminal and you get a popup "could not detach from caller"? If so, please check the shortcut properties for the actual command line ("Target:") and whether that's in fact your current 2.4.1 installation.
You are correct. The shortcut within the start menu, that I click, is pointed to:
C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico -
That is my current installation. When I run it, or try to run the command above from a cmd.exe, it reports: "Failed to could not fork child process: No such file or directory." I copied that exactly, the error message has an error in it.
Had same issue as @keithjjones. Installed today's cygwin on Windows 10 and get "Failed to could not fork child process: No such file or directory.", too. Only happens on a company computer and never see it on my home machine.
Ditto situation @zhanghaowx. The only difference with my personal Windows 10 machine and my work Windows 10 machine is the fact that at work I run Enterprise, so I am on a domain. I noticed when I run the bat file directly it reports my username as Unknown+User as seen above. Same thing happens with Git bash.
I suggest to update to 2.2.4. It includes enhanced startup error reporting which may give better indication about this issue.
Is it in the Cygwin installer now? I can try it Monday.
Updated to 2.2.4 this morning. When starting Cygwin I get "Error: could not fork child process: There are no available terminals." This is a different error, but it is still an error. What else would you like for me to run for you?
... which points us back to https://github.com/mintty/mintty/issues/493#issuecomment-184114716 above;
this is a system resource issue that mintty cannot handle. Have you recently rebooted?
Likely a call to the cygwin tool rebaseall could help.
I just rebooted. Same issue. I ran a command prompt, and ran \cygwin64\binash.exe and ran /bin/rebaseall and I get:
$ /bin/rebaseall
rebase: failed to open rebase database "/etc/rebase.db.x86_64":
Permission denied
I ran an administrative shell, ran ash.exe, and ran /bin/rebaseall and it did not say anything. It just gave me my prompt back.
In either case, mintty still hangs with the same output after the rebaseall execution.
Any permission problems? Did you install cygwin as somebody else?
What does id; ls -l /etc/rebase.db.x86_64 say?
I guess it might be a good idea to consider reinstallation of cygwin. If you have many packages, you might try a parallel minimal installation first (into some other target folder).
I installed it using the same account I am currently using. I am an administrator on the machine too.
Here is what you requested:
Unknown+User@DESKTOP ~
$ id
uid=4294967295(Unknown+User) gid=4294967295(Unknown+Group) groups=401408(Medium Mandatory Level),559(Performance Log Users),545(Users),4(INTERACTIVE),66049(CONSOLE LOGON),11(Authenticated Users),15(This Organization),66048(LOCAL),4294967295(Unknown+Group),262180(Cloud Account Authentication)
Unknown+User@DESKTOP ~
$ ls -l /etc/rebase.db.x86_64
-rw-rw---- 1 Unknown+User Unknown+Group 5670 Mar 21 12:05 /etc/rebase.db.x86_64
It can't tell who is the user is, as I've stated before. That may be due to the fact that I am running Enterprise and a domain user.
I've deleted the Cygwin directory and reinstalled before (before this morning) without any different results. If you think it will work, I'll try it again, but I just ran the setup this morning to get the new version of mintty you alerted me to. I would think that would have incorporated any permission changes, no?
This looks like you've installed cygwin on a network drive? What does ls -n /etc/rebase.db.x86_64 say?
It's definitely not a network drive. I don't have any network drives in use with this system, yet. I just installed Windows 10 fresh on it last week. I didn't upgrade from any other Windows versions either.
My install is in c:\cygwin64\
Here is the output you wanted:
Unknown+User@DESKTOP ~
$ ls -n /etc/rebase.db.x86_64
-rw-rw---- 1 4294967295 4294967295 5670 Mar 21 12:05 /etc/rebase.db.x86_64
I ran into this problem today after Windows rebooted last night. I cannot even run rebaseall in ash as I get:
` 3 [main] ash (7960) C:\cygwin\binash.exe: *** fatal error - cygheap base mismatch detected - 0xF8B400/0xD2B400.
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.
1 [main] ash 6804 fork: child -1 - forked process 7960 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
ash: 2: Cannot fork`
The cygwin1.dll in \cygwin\bin is dated 8/20/2015 so has not changed. I can find no other on my computer.
EDIT: gave up and just wiped c:\cygwin and reinstalled from scratch
Well, I sort of found the issue. It's definitely caused by a user being on a domain, AzureAD, specifically. I created a local admin account and Cygwin/Git Bash run just fine on the same machine.
i'm facing the same problem. how to resolve this. try to rebaseall, but not worked.
I'm having the same issue. Cygwin doesn't seem to work properly when invoked from a domain account on an Azure AD joined machine.
Trying to launch the Cygwin64 Terminal results in -
Error: could not fork child process: There are no available terminals.
bash can be started via cmd.exe, but many utilities don't work properly. I think its due to Cygwin being unable to determine a user's id when logged in via an Azure AD account -
C:\cygwin64>bin\bash -l
Unknown+User@DESKTOP-3PFRJV1 ~
$ whoami
Unknown+User
Unknown+User@DESKTOP-3PFRJV1 ~
$ tmux
open terminal failed: not a terminal
Unknown+User@DESKTOP-3PFRJV1 ~
$ whoami
Unknown+User
Unknown+User@DESKTOP-3PFRJV1 ~
$ id
uid=4294967295(Unknown+User) gid=4294967295(Unknown+Group) groups=405504(High Mandatory Level),544(Administrators),545(Users),4(INTERACTIVE),66049(CONSOLE LOGON),11(Authenticated Users),15(This Organization),66048(LOCAL),4294967295(Unknown+Group),262180(Cloud Account Authentication)
Unknown+User@DESKTOP-3PFRJV1 ~
$
Other utilities, like X, are break with similar errors.
Just upgraded to gitwin 2.9.2, same issue. However I think @keithjjones @bcampitf might be on to something here. My PC is also a member of an Azure AD domain.
I wouldn't expect a git upgrade to change anything since git has not updated its mintty version for a while.
I have the same issue since yesterday. And my computer joined an Azure AD domain yesterday.
So then your issue is #563, not this one.
Thanks, I didn't notice this issue.
I'm having this issue now on Windows 10, version 1607, os build 14393.187.
I just installed Docker for Windows, and now this occurs. You can have docker or msys+mintty but not both?
Anyone else seeing this?
Which issue? Please describe your symptoms. Also, which version of mintty and cygwin (or msys) do you run?
Same as original issue description above. Turned out to be temporary did not reproduce after reboot.
Same as original issue description above.
That's not possible wth the current version (message modified). That's why basic version information often helps with bug reports, just to notice.
Updated and the error came back. Now it says "Error: could not fork child process: There are no available terminals (-1)."
What does uname -a say?
uname -a
MSYS_NT-10.0 WPOSTMA 2.4.0(0.293/5/3) 2016-01-12 10:22 x86_64 Msys
You are most likely having a problem with a Windows Azure domain as described above.
This issue was solved in cygwin 2.6.0 by a workaround.
You will have to update MSYS, or maybe wait until MSYS adopts that update.
Version info should be 2.6.0 then (currently 2.4.0).
I'm having the same problem. I have recognized that it is related to processes dangling around after having closed previous cygwin bash windows. Killing those processes fixes the issue. One of those processes is ssh-agent. Another one is chromedriver still dangling around because unit tests got aborted without shutting it down properly. Going to the task manager and killing those processes helps.
I'm now using "cmd /C bash -l" instead to get rid of this.
Please report your versions: uname -a, winver, mintty -V.
CYGWIN_NT-10.0 DESKTOP-067JGU8 2.8.0(0.309/5/3) 2017-04-01 20:47 x86_64 Cygwin
Windows 10 version 1607 build 14393.1066
mintty 2.7.6 x86_64-pc-cygwin
I don't think this is a mintty issue. It might be a BLODA issue. Please try to start another terminal in the same situation (e.g. xterm, after starting an X server).
I'm having the same problem, details as follows:
CYGWIN_NT-6.1 WIN-5AL4S0BCGVG 2.9.0(0.318/5/3) 2017-09-12 10:18 x86_64 Cygwin
mintty 2.8.1 x86_64-pc-cygwin
If i run mintty.exe in bash .it works fine.
but ,if i run mintty.exe in a windows shell ,it does not work
Even if you think it's the same, please describe your precise symptoms.
Here is the fix.
1 Go to you Windows Defender Security Center settings
2 Click on App & Browser Control
3 At the bottom click on the "Exploit Protection Settings" link
4 Go to "Program Settings" and click on the "Add program to customize" -> "Choose exact file path"
5 Navigate to "C:\Program Files\Git\usr\bin\sh.exe" and add it
6 Override and turn off the following:
Mandatory ASLR
Randomize memory allocations (Bottom-up ASLR)
7 Click "Apply" and now everything should work fine.
Good luck,
Gabriel
Life saving... this windows update is so annoying, why does windows keep enabling things I already had disabled T_T
Most helpful comment
Here is the fix.
1 Go to you Windows Defender Security Center settings
2 Click on App & Browser Control
3 At the bottom click on the "Exploit Protection Settings" link
4 Go to "Program Settings" and click on the "Add program to customize" -> "Choose exact file path"
5 Navigate to "C:\Program Files\Git\usr\bin\sh.exe" and add it
6 Override and turn off the following:
Mandatory ASLR
Randomize memory allocations (Bottom-up ASLR)
7 Click "Apply" and now everything should work fine.
Good luck,
Gabriel