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

Mintty does not work under Windows 10 build 10586 #493

Closed
eXistenZNL opened this issue Nov 14, 2015 · 87 comments
Closed

Mintty does not work under Windows 10 build 10586 #493

eXistenZNL opened this issue Nov 14, 2015 · 87 comments

Comments

@eXistenZNL
Copy link

@eXistenZNL eXistenZNL commented Nov 14, 2015

Problem description

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.

Reproduction scenario

  1. Install Windows 10 (build 10240 RTM) x64 and install Cygwin x64.
  2. Observe that using Mintty is working great.
  3. Run Windows update so it updates to build 10586.
  4. Observe that Mintty refuses to work anymore, and crashes with the error
    /usr/bin/mintty: could not detach from caller Try '--help' for more information.'.

Expected behaviour

A working Mintty =)

Shoot!

If further questions exist, just ask. I will be notified and will answer the questions.

@eXistenZNL eXistenZNL changed the title Mintty does not work under Windows 10 build 10586 MinTTY does not work under Windows 10 build 10586 Nov 14, 2015
@mintty
Copy link
Owner

@mintty mintty commented Nov 15, 2015

You are using the current version of mintty?
Try mintty -d as a workaround, please.

@mintty
Copy link
Owner

@mintty mintty commented Nov 15, 2015

How did you actually invoke mintty?
From shortcut, from Cygwin console, otherwise?

@mintty
Copy link
Owner

@mintty mintty commented Nov 15, 2015

And can you check the current uploaded version?

@eXistenZNL
Copy link
Author

@eXistenZNL eXistenZNL commented Nov 15, 2015

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.

@eXistenZNL eXistenZNL changed the title MinTTY does not work under Windows 10 build 10586 Mintty does not work under Windows 10 build 10586 Nov 15, 2015
@mintty
Copy link
Owner

@mintty mintty commented Nov 17, 2015

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".

mintty added a commit that referenced this issue Nov 19, 2015
@eXistenZNL
Copy link
Author

@eXistenZNL eXistenZNL commented Nov 19, 2015

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
Copy link
Owner

@mintty mintty commented Nov 19, 2015

??
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.

@dankessler
Copy link

@dankessler dankessler commented Nov 30, 2015

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

@mintty
Copy link
Owner

@mintty mintty commented Nov 30, 2015

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?

@albertxing
Copy link

@albertxing albertxing commented Dec 1, 2015

Okay, I've built mintty from source (git clone && make).
The console starts up now, but it gives an error instead of the prompt:

image

@adipose
Copy link

@adipose adipose commented Dec 1, 2015

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.

@mintty
Copy link
Owner

@mintty mintty commented Dec 1, 2015

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.

@eXistenZNL
Copy link
Author

@eXistenZNL eXistenZNL commented Dec 1, 2015

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.

@mintty
Copy link
Owner

@mintty mintty commented Dec 1, 2015

Actually git pull is overkill for just trying the current version. There is a Download ZIP button top right on the project page.

@eXistenZNL
Copy link
Author

@eXistenZNL eXistenZNL commented Dec 1, 2015

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.

@mintty
Copy link
Owner

@mintty mintty commented Dec 1, 2015

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.

@albertxing
Copy link

@albertxing albertxing commented Dec 1, 2015

@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.

@albertxing
Copy link

@albertxing albertxing commented Dec 1, 2015

Nope, reinstalling msys didn't solve the issue

@eXistenZNL
Copy link
Author

@eXistenZNL eXistenZNL commented Dec 1, 2015

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.

@mintty
Copy link
Owner

@mintty mintty commented Dec 1, 2015

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?

@adipose
Copy link

@adipose adipose commented Dec 1, 2015

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.

@adipose
Copy link

@adipose adipose commented Dec 1, 2015

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.

@mintty
Copy link
Owner

@mintty mintty commented Dec 3, 2015

See the discussion around https://cygwin.com/ml/cygwin/2015-12/msg00010.html which again confirms this is not a mintty issue.

@adipose
Copy link

@adipose adipose commented Dec 3, 2015

Interesting. I have 32-bit cygwin, so I'm not sure that applies to me.

@albertxing
Copy link

@albertxing albertxing commented Dec 3, 2015

@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.

@mintty
Copy link
Owner

@mintty mintty commented Dec 4, 2015

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.

@keithjjones
Copy link

@keithjjones keithjjones commented Mar 21, 2016

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?

@mintty
Copy link
Owner

@mintty mintty commented Mar 21, 2016

This looks like you've installed cygwin on a network drive? What does ls -n /etc/rebase.db.x86_64 say?

@keithjjones
Copy link

@keithjjones keithjjones commented Mar 21, 2016

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
@paulraines68
Copy link

@paulraines68 paulraines68 commented Mar 22, 2016

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\bin\ash.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

@keithjjones
Copy link

@keithjjones keithjjones commented Mar 22, 2016

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.

@jeffery9
Copy link

@jeffery9 jeffery9 commented Jun 18, 2016

i'm facing the same problem. how to resolve this. try to rebaseall, but not worked.

@briancamp
Copy link

@briancamp briancamp commented Jun 26, 2016

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.

@grabcocque
Copy link

@grabcocque grabcocque commented Jul 25, 2016

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.

@mintty
Copy link
Owner

@mintty mintty commented Jul 25, 2016

I wouldn't expect a git upgrade to change anything since git has not updated its mintty version for a while.

@simonjodet
Copy link

@simonjodet simonjodet commented Aug 17, 2016

I have the same issue since yesterday. And my computer joined an Azure AD domain yesterday.

@mintty
Copy link
Owner

@mintty mintty commented Aug 17, 2016

So then your issue is #563, not this one.

@simonjodet
Copy link

@simonjodet simonjodet commented Aug 18, 2016

Thanks, I didn't notice this issue.

@wpostma
Copy link

@wpostma wpostma commented Sep 27, 2016

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?

@mintty
Copy link
Owner

@mintty mintty commented Sep 27, 2016

Which issue? Please describe your symptoms. Also, which version of mintty and cygwin (or msys) do you run?

@wpostma
Copy link

@wpostma wpostma commented Sep 27, 2016

Same as original issue description above. Turned out to be temporary did not reproduce after reboot.

@mintty
Copy link
Owner

@mintty mintty commented Sep 28, 2016

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.

@wpostma
Copy link

@wpostma wpostma commented Sep 28, 2016

Updated and the error came back. Now it says "Error: could not fork child process: There are no available terminals (-1)."

@mintty
Copy link
Owner

@mintty mintty commented Sep 28, 2016

What does uname -a say?

@wpostma
Copy link

@wpostma wpostma commented Sep 28, 2016

uname -a 
MSYS_NT-10.0 WPOSTMA 2.4.0(0.293/5/3) 2016-01-12 10:22 x86_64 Msys


@mintty
Copy link
Owner

@mintty mintty commented Sep 29, 2016

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).

@jjYBdx4IL
Copy link

@jjYBdx4IL jjYBdx4IL commented May 6, 2017

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.

@mintty
Copy link
Owner

@mintty mintty commented May 6, 2017

Please report your versions: uname -a, winver, mintty -V.

@jjYBdx4IL
Copy link

@jjYBdx4IL jjYBdx4IL commented May 6, 2017

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

@mintty
Copy link
Owner

@mintty mintty commented May 6, 2017

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).

@tsinhi
Copy link

@tsinhi tsinhi commented Dec 5, 2017

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

@mintty
Copy link
Owner

@mintty mintty commented Dec 5, 2017

Even if you think it's the same, please describe your precise symptoms.

@gamitech
Copy link

@gamitech gamitech commented Jan 29, 2018

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

@kryztoval
Copy link

@kryztoval kryztoval commented Feb 16, 2018

Life saving... this windows update is so annoying, why does windows keep enabling things I already had disabled T_T

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

Successfully merging a pull request may close this issue.

None yet