ssh client sometimes hangs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openssh (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
$ lsb_release -rd
Description: Ubuntu 8.10
Release: 8.10
$ apt-cache policy openssh-client
openssh-client:
Installed: 1:5.1p1-3ubuntu1
Candidate: 1:5.1p1-3ubuntu1
Version table:
*** 1:5.1p1-3ubuntu1 0
500 http://
100 /var/lib/
I have .ssh key files that I generated years ago. I copied them to ~/.ssh on my ubuntu system. Most of the time when I use ssh to run a command on another system it works fine. Once in 50 times ssh hangs locally.
This is not a network problem ... same issue happens with "localhost". E.g. if I run:
$ while :
> do ssh localhost date
> done
It will print the date a few dozen times, then the loop hangs (^C interrupts it).
I tried using strace to see what was happening. The ssh process was hung reading from a socket.
Looking back through the strace, the socket was connected to some local keyring thing.
Here are some relevent lines from strace output:
socket(PF_FILE, SOCK_STREAM, 0) = 4
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
connect(4, {sa_family=AF_FILE, path="/
write(4, "\0\0\0\1", 4) = 4
write(4, "\v", 1) = 1
read(4, "\0\0\2h", 4) = 4
read(4, "\f\0\0\
write(3, "$K \250\310\
select(4, [3], NULL, NULL, NULL) = 1 (in [3])
read(3, "\34t\351\
futex(0x7f95665
futex(0x7f95665
futex(0x7f95673
futex(0x7f95671
futex(0x7f95671
....
open("/
fstat(5, {st_mode=
read(5, "\21\207y;
close(5) = 0
write(3, "\314\331H\
select(4, [3], NULL, NULL, NULL) = 1 (in [3])
read(3, "\234?r\
brk(0x7f95690d9000) = 0x7f95690d9000
brk(0x7f95690d8000) = 0x7f95690d8000
write(4, "\0\0\1\207", 4) = 4
write(4, "\r\0\0\
read(4, 0x7fff703fa880, 4) = ? ERESTARTSYS (To be restarted)
--- SIGINT (Interrupt) @ 0 (0) ---
+++ killed by SIGINT +++
A hung ssh process is often revived when some other outging ssh request
is initiated. Quite often the snoozy process wakes up and runs normally.
But sometimes it wakes up and reports a failed connection.
Just upgraded to 9.04 (Jaunty Jackalope). No change in behaviour. The
while :
do ssh localhost date
done
loop still hangs periodically (and can often be unjammed by running another
"ssh somesystem ..." in another terminal window.