Subject: Re: ssh blocking in ttyout
To: Charles M. Hannum <root@ihack.net>
From: Andrew Isaacson <adisaacs@mtu.edu>
List: current-users
Date: 11/03/1998 13:37:48
On Tue, Nov 03, 1998 at 12:09:59PM -0500, Charles M. Hannum wrote:
> > System: -current as of about 2 weeks ago, running on a 386sx-16, using
> > pcvt console.
> > 
> > On a virtual console, I ssh to another host.  It works fine for a
> > while, but eventually the ssh session "locks up"; it doesn't respond
> > to anything I type.  Switching to another VC, ps axl reveals:
> 
> What is the other host in this scenario?  What OS is it running?  What
> do `netstat -A' and `netstat -P' show for your ssh connection (after
> it's hung for a couple of minutes is best)?

I've seen it when connected to Solaris 2.5.1 and Linux 2.0.35.

It seems to me like this isn't related to a TCP problem at all; the
connection looks fine to me.  It certainly seems like it's hanging
while writing to the screen.  Nonetheless, here's some netstat output.

I've got a connection that's been hung for about an hour:

(pirx is my NetBSD host; gandalf is Linux 2.0.35)

% netstat -A
Active Internet connections
PCB      Proto Recv-Q Send-Q  Local Address      Foreign Address    (state)
[snip]
f03c499c tcp        0      0  pirx.1023          gandalf.22         ESTABLISHED

% netstat -P f03c499c
TCP Protocol Control Block at 0xf03c499c:

Timers:
	REXMT: 0	PERSIST: 0	KEEP: 1255645	2MSL: 0

State: ESTABLISHED, flags 0x38a4, inpcb 0xf03c28fc

rxtshift 0, rxtcur 2, dupacks 0
peermss 1460, ourmss 1460, segsz 1460

snd_una 1581998473, snd_nxt 1581998473, snd_up 1581998473
snd_wl1 2482604382, snd_wl2 1581998473, iss 1581990429, snd_wnd 32736

rcv_wnd 17520, rcv_nxt 2482604383, rcv_up 2482604383, irs 2482441143

rcv_adv 2482621903, snd_max 1581998473, snd_cwnd 4380, snd_ssthresh 1073725440
idle 1441, rtt 0, rtseq 1581998453, srtt 10, rttvar 7, rttmin 2, max_sndwnd 32736

oobflags 0, iobc 0, softerror 0

snd_scale 0, rcv_scale 0, req_r_scale 0, req_s_scale 0
ts_recent 0, ts_regent_age 0, last_ack_sent 2482604383

I then killed the slrn process on the remote host, which presumably
caused the remote sshd to send stuff to my ssh process.  Here's what
the connection looks like after the kill:

% netstat -A
Active Internet connections
PCB      Proto Recv-Q Send-Q  Local Address      Foreign Address    (state)
f03c499c tcp      196      0  pirx.1023          gandalf.22         ESTABLISHED

% netstat -P f03c499c

TCP Protocol Control Block at 0xf03c499c:

Timers:
	REXMT: 0	PERSIST: 0	KEEP: 1257270	2MSL: 0

State: ESTABLISHED, flags 0x38a4, inpcb 0xf03c28fc

rxtshift 0, rxtcur 2, dupacks 0
peermss 1460, ourmss 1460, segsz 1460

snd_una 1581998473, snd_nxt 1581998473, snd_up 1581998473
snd_wl1 2482604382, snd_wl2 1581998473, iss 1581990429, snd_wnd 32736

rcv_wnd 17520, rcv_nxt 2482604579, rcv_up 2482604383, irs 2482441143

rcv_adv 2482621903, snd_max 1581998473, snd_cwnd 4380, snd_ssthresh 1073725440
idle 444, rtt 0, rtseq 1581998453, srtt 10, rttvar 7, rttmin 2, max_sndwnd 32736

oobflags 0, iobc 0, softerror 0

snd_scale 0, rcv_scale 0, req_r_scale 0, req_s_scale 0
ts_recent 0, ts_regent_age 0, last_ack_sent 2482604579

And ps after I killed the remote slrn:

% ps axl
  UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT TT       TIME COMMAND
    0 16470 15092   0   4  0   360  816 ttyout I+   v1    0:20.08 ssh gandalf (

HTH,
-andy
-- 
Andy Isaacson adisaacs@mtu.edu adi@acm.org    Fight Spam, join CAUCE:
http://www.csl.mtu.edu/~adisaacs/              http://www.cauce.org/