I am aware that there have been several posts related to ssh connections hanging, i have tried to read through most of them in the archives... I am posting this in hopes that it may present something new that will further help resolve this problem. The problem i am having appears to be similar to what others have reported where after typing exit in an interactive shell the connection is not closed unitl an additional _one_ key stroke is issued (space-bar, enter, etc...). The sshd server is OpenSSH_2.9p1 on HPUX-11.00. I have tried connecting using the OpenSSH_2.9p1 ssh client from Linux-2.4, HPUX-11.00 and FreeBSD-4.2. The behavior so far is _always_ consistent: 1) establish connection to sshd using ssh simply via "ssh remote-host" 2) type exit in interactive shell on remote-host. 3) "logout" is echoed to the terminal and the local shell prompt is NOT echoed. 4) type any other key, usually i just hit the space-bar. <<--PROBLEM IS HERE 5) "Connection to remote-host closed." is echoed to the terminal followed by the local shell prompt. If i do a ps from another session on the remote-host (HPUX-11.00) before doing step 4 from above (hitting space-bar) this is what i see (cleaned-up to removed non-related processes): ---- sysadm$ ps -ef|grep abush UID PID PPID C STIME TTY TIME COMMAND root 20088 15876 0 17:49:31 ? 0:00 sshd: abush at 4 abush 20090 20088 0 17:49:32 ? 0:00 <defunct> ---- An additional problem that appears to be realted to this is (but does not happen 100% of the time) is that a scp of a file from a HPUX-11.00 sshd server will hang indefinitely. Looking at the same ps output will show the same <defunct> process again. ---- The problem is only seen when the sshd server is running on HPUX, connections betweeen other hosts respond as expected. I can also provide output from sshd -d and ssh -v -v -v if needed and anything else that might help to clear this up. Thanks, -ab
On Tue, 5 Jun 2001, Aaron Bush wrote: :The problem i am having appears to be similar to what others have :reported where after typing exit in an interactive shell the connection :is not closed unitl an additional _one_ key stroke is issued (space-bar, :enter, etc...). : :The sshd server is OpenSSH_2.9p1 on HPUX-11.00. I have tried connecting :using the OpenSSH_2.9p1 ssh client from Linux-2.4, HPUX-11.00 and :FreeBSD-4.2. The behavior so far is _always_ consistent: : :1) establish connection to sshd using ssh simply via "ssh remote-host" :2) type exit in interactive shell on remote-host. :3) "logout" is echoed to the terminal and the local shell prompt is NOT :echoed. :4) type any other key, usually i just hit the space-bar. <<--PROBLEM IS :HERE :5) "Connection to remote-host closed." is echoed to the terminal :followed by the local shell prompt. can you try the patch at the end? hp-ux (and possibly the other systems you mentioned) restart select() when SA_RESTART which we were setting for SIGCHLD, and we should not have select() restarted. i would also be interested in someone with Unixware trying this so we can further verify issues with grantpt(), which is why we added the restart code in the first place. :If i do a ps from another session on the remote-host (HPUX-11.00) before :doing step 4 from above (hitting space-bar) this is what i see :(cleaned-up to removed non-related processes): :---- :sysadm$ ps -ef|grep abush : UID PID PPID C STIME TTY TIME COMMAND : root 20088 15876 0 17:49:31 ? 0:00 sshd: abush at 4 : abush 20090 20088 0 17:49:32 ? 0:00 <defunct> : :---- :An additional problem that appears to be realted to this is (but does :not happen 100% of the time) is that a scp of a file from a HPUX-11.00 :sshd server will hang indefinitely. Looking at the same ps output will :show the same <defunct> process again. i'm not positive, but i think this will fix that issue as well. :The problem is only seen when the sshd server is running on HPUX, :connections betweeen other hosts respond as expected. : :I can also provide output from sshd -d and ssh -v -v -v if needed and :anything else that might help to clear this up. Index: misc.c ==================================================================RCS file: /var/cvs/openssh/misc.c,v retrieving revision 1.20 diff -u -r1.20 misc.c --- misc.c 2001/05/12 00:08:38 1.20 +++ misc.c 2001/06/05 20:55:54 @@ -220,7 +220,7 @@ memset(&sa, 0, sizeof(sa)); sigemptyset(&sa.sa_mask); sa.sa_flags = 0; -#if defined(SA_RESTART) +#if 0 if (sig == SIGCHLD) sa.sa_flags |= SA_RESTART; #endif
openssh-unix-dev at thewrittenword.com
2001-Jun-07 11:12 UTC
HPUX: ssh hangs after shell exit
On Tue, Jun 05, 2001 at 05:30:45PM -0400, Aaron Bush wrote:> I am aware that there have been several posts related to ssh connections > hanging, i have tried to read through most of them in the archives... I > am posting this in hopes that it may present something new that will > further help resolve this problem. > > The problem i am having appears to be similar to what others have > reported where after typing exit in an interactive shell the connection > is not closed unitl an additional _one_ key stroke is issued (space-bar, > enter, etc...). > > The sshd server is OpenSSH_2.9p1 on HPUX-11.00. I have tried connecting > using the OpenSSH_2.9p1 ssh client from Linux-2.4, HPUX-11.00 and > FreeBSD-4.2. The behavior so far is _always_ consistent:We have *no* problems with 2.9p1 on HP-UX 11.00 here. We do use the HP commercial C compiler to build it. -- albert chin (china at thewrittenword.com)
On Tue, Jun 05, 2001 at 05:30:45PM -0400, Aaron Bush wrote:> 1) establish connection to sshd using ssh simply via "ssh remote-host" > 2) type exit in interactive shell on remote-host. > 3) "logout" is echoed to the terminal and the local shell prompt is NOT > echoed. > 4) type any other key, usually i just hit the space-bar. <<--PROBLEM IS > HERE > 5) "Connection to remote-host closed." is echoed to the terminal > followed by the local shell prompt.do you have ssh -v -v -v remote-host traces?
openssh-unix-dev at thewrittenword.com wrote:> > On Tue, Jun 05, 2001 at 05:30:45PM -0400, Aaron Bush wrote: > > I am aware that there have been several posts related to ssh connections > > hanging, i have tried to read through most of them in the archives... I > > am posting this in hopes that it may present something new that will > > further help resolve this problem. > > > > The problem i am having appears to be similar to what others have > > reported where after typing exit in an interactive shell the connection > > is not closed unitl an additional _one_ key stroke is issued (space-bar, > > enter, etc...). > > > > The sshd server is OpenSSH_2.9p1 on HPUX-11.00. I have tried connecting > > using the OpenSSH_2.9p1 ssh client from Linux-2.4, HPUX-11.00 and > > FreeBSD-4.2. The behavior so far is _always_ consistent: > > We have *no* problems with 2.9p1 on HP-UX 11.00 here. We do use the HP > commercial C compiler to build it. > > -- > albert chin (china at thewrittenword.com)I am using gcc 2.95.2 and the problem does exist. I have not tried the HP ANSI C compiler though. -ab
Kevin Steves wrote:> can you try the patch at the end? hp-ux (and possibly the other systems > you mentioned) restart select() when SA_RESTART which we were setting for > SIGCHLD, and we should not have select() restarted. >> > Index: misc.c > ==================================================================> RCS file: /var/cvs/openssh/misc.c,v > retrieving revision 1.20 > diff -u -r1.20 misc.c > --- misc.c 2001/05/12 00:08:38 1.20 > +++ misc.c 2001/06/05 20:55:54 > @@ -220,7 +220,7 @@ > memset(&sa, 0, sizeof(sa)); > sigemptyset(&sa.sa_mask); > sa.sa_flags = 0; > -#if defined(SA_RESTART) > +#if 0 > if (sig == SIGCHLD) > sa.sa_flags |= SA_RESTART; > #endifSorry for the delay in reponse... This patch has corrected the problems i have been having. I have been looking for documentation from HP regarding the behavior of SA_RESTART and have found nothing so far. Thanks, -ab