Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue

Cygwin list mailing list
I first reported this problem to the Mintty project at GitHub.  With their help, I was able to debug the issue to the call to forkpty.  I installed tmux and found it also hangs the exact same way.  My guess is any process which makes this fork call will hang in a similar way. Rather than copy/paste the thread, I'd rather just refer you to there : https://github.com/mintty/mintty/issues/960

I will also direct link to the strace log I made which includes my comment showing where the hang happens:
https://github.com/mintty/mintty/files/4136651/mintty.strace.log (Line 718 is the hanging point.)

Also Windows 10's analyze wait chain function in TaskManager shows the process waiting for Network I/O, but we see no evidence of network activity. https://i.imgur.com/Uiw9laH.png

I haven't seen any other windows applications hang thusly, so I'm at a loss for what I've done to my windows system to have caused this. Otherwise, I'd expect others to share my pain.  Any ideas?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

=?UTF-8?b?Y3lnY2hlY2sub3V0?= (45K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue

Takashi Yano
On Sat, 1 Feb 2020 07:39:08 +0000 (UTC)
"Anon User via cygwin" wrote:
> I first reported this problem to the Mintty project at GitHub.  With their help, I was able to debug the issue to the call to forkpty.  I installed tmux and found it also hangs the exact same way.  My guess is any process which makes this fork call will hang in a similar way. Rather than copy/paste the thread, I'd rather just refer you to there : https://github.com/mintty/mintty/issues/960
>
> I will also direct link to the strace log I made which includes my comment showing where the hang happens:
> https://github.com/mintty/mintty/files/4136651/mintty.strace.log (Line 718 is the hanging point.)
>
> Also Windows 10's analyze wait chain function in TaskManager shows the process waiting for Network I/O, but we see no evidence of network activity. https://i.imgur.com/Uiw9laH.png
>
> I haven't seen any other windows applications hang thusly, so I'm at a loss for what I've done to my windows system to have caused this. Otherwise, I'd expect others to share my pain.  Any ideas?

What happens if you run the following test code?

#include <stdio.h>
#include <unistd.h>
#include <pty.h>

int main()
{
        int pm, ps;
        printf("Start.\n");
        openpty(&pm, &ps, NULL, NULL, NULL);
        printf("PTY opened.\n");
        close(pm);
        close(ps);
        printf("PTY closed.\n");
        return 0;
}

--
Takashi Yano <[hidden email]>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue

Cygwin list mailing list
In reply to this post by Cygwin list mailing list
What happens is it hangs on that openpty() call.  It displays Start immediately.  But then around a minute later it shows the rest.

$ ./a.exe
Start.
** hangs here about 1 minute **
PTY opened.
PTY closed.

I took the liberty of adding time() calls just before and after the openpty() call:

$ ./a.exe
Start.
1580578712
PTY opened.
1580578772
PTY closed.

It turns out to be exactly 1 minute -- like there's a 60 second timeout waiting for something...

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue

Takashi Yano
On Sat, 1 Feb 2020 17:40:52 +0000 (UTC)
"Anon User via cygwin" wrote:
> $ ./a.exe
> Start.
> ** hangs here about 1 minute **
> PTY opened.
> PTY closed.

Thanks for testing.

Could you please let us know the result of
md5sum /bin/cygwin-console-helper.exe

--
Takashi Yano <[hidden email]>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue

Cygwin list mailing list
$ md5sum /bin/cygwin-console-helper.exe
221bdfff7c8ccd1227bacb025bba665b */bin/cygwin-console-helper.exe


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue

Takashi Yano
On Sat, 1 Feb 2020 23:25:08 +0000 (UTC)
"Anon User via cygwin" wrote:
> $ md5sum /bin/cygwin-console-helper.exe
> 221bdfff7c8ccd1227bacb025bba665b */bin/cygwin-console-helper.exe

This is the right md5sum value.
Then, how about the attached test case?

--
Takashi Yano <[hidden email]>


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

pcon_test_1min.c (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue

Cygwin list mailing list
Same behavior as mintty, tmux, the previous test case, with TaskManager's analyze wait chain saying it's waiting on Network I/O.

 $ ./a.exeStarted.
** 1 min wait here **
CreatePseudoConsole() end.ClosePseudoConsole() end.



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue

Takashi Yano
On Sun, 2 Feb 2020 08:31:51 +0000 (UTC)
"Anon User via cygwin" wrote:
> Same behavior as mintty, tmux, the previous test case, with TaskManager's analyze wait chain saying it's waiting on Network I/O.
>
>  $ ./a.exeStarted.
> ** 1 min wait here **
> CreatePseudoConsole() end.ClosePseudoConsole() end.

From this result, it seems that this is not a cygwin problem.
But your system has a problem regarding CreatePseudoConsole() call.

I guess Microsoft's OpenSSH server also behaves the same.

--
Takashi Yano <[hidden email]>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue

Cygwin list mailing list
 Not sure how to confirm that.  I install the built-in OpenSSH client/server app.  Then I start the OpenSSH server service.  Then I ssh to 127.0.0.1 and login fine.  There is no waiting on the service starting up nor on the ssh client connecting to the daemon and getting a shell (Windows 'DOS' shell though, not bash). I have not seen this hanging outside cygwin yet.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue

Takashi Yano
On Sun, 2 Feb 2020 09:14:25 +0000 (UTC)
"Anon User via cygwin" wrote:
>  Not sure how to confirm that.  I install the built-in OpenSSH client/server app.  Then I start the OpenSSH server service.  Then I ssh to 127.0.0.1 and login fine.  There is no waiting on the service starting up nor on the ssh client connecting to the daemon and getting a shell (Windows 'DOS' shell though, not bash). I have not seen this hanging outside cygwin yet.

Hmm. Then, could you please compile the previous test case
using x86_64-w64-mingw32-gcc (mingw compiler) and run the
program in pure command prompt (witout cygwin)?

--
Takashi Yano <[hidden email]>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue

Cygwin list mailing list
 Sure. I'm willing to try it. Where do I get that compiler from?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue

Cygwin list mailing list
In reply to this post by Takashi Yano
OK I found it.  You're right. The same outcome occurs.  So I guess it's not cygwin specific.  Sorry to have wasted your time.  I guess my Windows install is messed up somehow. I wish I could get the feedback I need to figure out what I did to have caused this.  I have tried countless searches online for the analyze wait chain result.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Mintty/tmux hangs for 1 minute on startup - seems to be a forking issue

Cygwin list mailing list
On 2020-02-02 10:48, Anon User via cygwin wrote:
> OK I found it.  You're right. The same outcome occurs.  So I guess it's not cygwin specific.  Sorry to have wasted your time.  I guess my Windows install is messed up somehow. I wish I could get the feedback I need to figure out what I did to have caused this.  I have tried countless searches online for the analyze wait chain result.
>

Wild guess:

If you have inaccesssible network drives, many calls give a 30S timeout.
try googling "windows show hidden drives" or see what you get with:
"net use"


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple