-
Notifications
You must be signed in to change notification settings - Fork 740
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 sometimes hangs on connect #1273
Comments
There's no |
Here are the last few lines of a ktrace (OpenBSD equivalent of strace?), captured with
I think the |
If I'm reading that correctly, it's read the |
Here's the end of a more complete ktrace output which includes the Based on the complete ktrace output, I found these PIDs:
It looks like |
mosh-server forks and detaches. It shouldn't be responsible for closing the connection per se |
If I run |
Yes that's expected. Mosh requires a running mosh-server process to talk to. |
I added some printf debugging (to a log file) to mosh-server. It seems like it's getting stuck on My printf-laden code looks like this (
and the end of the log is |
Is there any way to see which bytes are not flushed? I'm not super familiar with debugging on the BSDs to know how to do that offhand. |
I don't know a reliable way, but I found some evidence the unflushed bytes are "[mosh server detached..." and "Warning: termios IUTF8 flag...". Details: I ktraced sshd's children including
However, these final two messages don't have matching reads:
That last ioctl is the last I see of 19928. I guess something is causing sshd to decide to stop reading? (I've been trying to reproduce the tcdrain hang with a simple program that forks, and has the child process close stdout and the parent sleep(1) then try to write to stdout and then tcdrain(1). I ssh to my VM using that program as the command to run. But so far I haven't been able to reproduce, i.e, I can't get tcdrain to hang.) |
It begins with the sshd process calling ppoll(...,3,...): listening on 3 fds. Then one last message is written by Then the sshd process reads what I guess is a network packet. Then it closes fd 8, and the next call to ppoll has 2 instead of 3. |
Is there any evidence this is not a bug in ssh? |
I don't know. I wish I knew the exact sequence of events which is causing If I spend more time on this, I think my next step will be to remove things from |
Sometimes, when I try to use mosh to connect to a VM running on my computer, mosh just prints a couple of blank lines and does nothing else:
(
h4
is the VM.) Ctrl-c and ctrl-\ do nothing. No mosh TUI with a blue banner or anything; it's as if I typedecho;echo;cat>/dev/null
and somehow disabled ctrl-c and ctrl-\.pgrep
shows there are threemosh-server
processes on the VM and nomosh-client
processes on the host.The host machine (i.e. mosh client) runs OpenBSD-current amd64. The VM runs OpenBSD 7.3. Both have mosh 1.4.0.
Here is an excerpt from
pstree
output on the host where I ranmosh h4
:This bug isn't consistent: usually
mosh h4
successfully sets up a remote session onh4
.I don't think I've observed this when connecting to a machine that isn't a VM on the same computer. (I wonder if it's got something to do with network to the VM being super low-latency.)
I saw #114 which looks quite similar, but it's old and closed, and I'm running mosh 1.4.0 on OpenBSD.
The text was updated successfully, but these errors were encountered: