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

mosh-client exits unexpectedly on Cygwin when using Windows console #705

Closed
danrsc opened this issue Dec 26, 2015 · 4 comments
Closed

mosh-client exits unexpectedly on Cygwin when using Windows console #705

danrsc opened this issue Dec 26, 2015 · 4 comments

Comments

@danrsc
Copy link

@danrsc danrsc commented Dec 26, 2015

mosh-client is exiting unexpectedly for me after 10 seconds - 1 minute. This seems to happen regardless of what I type (though it seems I must type to cause the issue). I tried typing the alphabet and there does not seem to be a particular character that causes the problem. I am invoking mosh through the cygwin terminal (i.e. in bash). If I invoke script and then invoke mosh within the script session, then I do not reproduce the behavior (i.e. the mosh-client does not exit unexpectedly). I have attached a screen shot of how it looks when the session has exited (which does not have any useful information). I also have run mosh-server in debug mode and mosh-client with strace (for the same session). I have attached the output from both.

On the client I am running:
Windows 10 Pro (version 1511) build 10586.36
cygwin 2.3.1
and the mosh version that installs with the cygwin installer (1.2.5-1)

I have two different servers that I'm trying to connect to; both reproduce the issue. On the servers I built mosh myself. Mosh version 1.2.5 using protbuf version 2.6.1:
Linux 2.6.35.9-004-F14_64 #1 SMP PREEMPT Thu Sep 18 12:31:45 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
LSB Version: :core-4.0-amd64:core-4.0-noarch
Distributor ID: Fedora
Description: Fedora release 14 (Laughlin)
Release: 14
Codename: Laughlin

Linux 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
LSB Version: :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.2 (Final)
Release: 6.2
Codename: Final

mosh_client
mosh_server_debug.txt
mosh_strace_output.txt

@cgull
Copy link
Member

@cgull cgull commented Dec 27, 2015

OK, I've now managed to reproduce this on my personal Win7Pro laptop with development Mosh sources, talking to a server about 10ms away. Mosh exits with no notification of problems after I've been typing a little while. This is likely different enough from your system that I don't think it's related to Win10 or any particular configuration you have.

But I can only reproduce it in Windows console, not in mintty. In the terminal you're using (before you start mosh) can you type ps -p $PPID, and tell me what command is listed? (It might be none at all, in which case you're using Windows console.)

What's the exit status of mosh-client when it fails? (Type echo $? immediately after mosh exits.)

If you are using Windows console, please try using mintty, and report whether Mosh still exits unexpectedly. You need to use mintty or another fully-featured terminal emulator anyway, the primitive ANSI-terminal emulation in Windows console doesn't work well with Mosh and you'll get corrupted screens. Even if this fixes your problem, I still want to chase this problem down a little further in case there's a bug/weakness in Mosh in this area.

@danrsc
Copy link
Author

@danrsc danrsc commented Dec 27, 2015

Yes you're right. When I run ps -p $PPID I do not get anything back, and if I run with mintty then mosh-client seems to behave correctly. echo $ does not give anything.

Thanks for your help!

Dan

@cgull
Copy link
Member

@cgull cgull commented Dec 28, 2015

This appears to be a bug in Cygwin's select() coupled with poor error handling in mosh-client: https://cygwin.com/ml/cygwin/2015-12/msg00332.html

@cgull cgull changed the title mosh-client exits unexpectedly mosh-client exits unexpectedly on Cygwin when using Windows console Jan 11, 2016
@cgull
Copy link
Member

@cgull cgull commented Jan 11, 2016

The Cygwin maintainer has finally fixed the Cygwin bug, see the linked email thread. I'll also commit a workaround for the bug, and changes to make our tests work under Cygwin (though they wouldn't have caught this issue, since tmux is not a Windows console).

@cgull cgull mentioned this issue Jan 13, 2016
@cgull cgull closed this in 6b71351 Jan 17, 2016
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
2 participants