SSH connection hanging on logout

mouring at etoh.eviladmin.org mouring at etoh.eviladmin.org
Thu May 10 14:16:43 EST 2001



On Thu, 10 May 2001, Damien Miller wrote:

> On 8 May 2001, John Bowman wrote:
>
> > As is well known, current versions of openssh hang upon exit when
> > background processes exist.
> >
> > If these processes do not produce output to stdout or stderr they should be
> > allowed to continue to run silently.  (If they do try to produce output,
> > they will be killed by the shell.)  This would be consistent with the
> > behaviour of rsh, ssh, rlogin, telnet, csh, and bash.  In no case should
> > openssh wait around for them indefinitely.
> >
> > Ssh is supposed to be a secure implementation of rsh and openssh is
> > supposed to be a open source version of ssh, so despite a few suggestions
> > to the contrary, this *really* is a bug.
> >
> > The following patch to openssh-2.9p1 fixes the problem. This patch has now
> > been thoroughly tested and is believed not to break ssh or scp, unlike
> > previous related attempts.
>
> The patch does not work for protocol 1:
>
> while [ 1 ] ; do ssh -p 2222 -o Protocol=1 -oForwardX11=no djm at localhost dd if=/dev/zero bs=1024 count=100 | wc -c ; done
>
> Write failed flushing stdout buffer.
> 100+0 records in
> 100+0 records out
>   16384

Try against the latest CVS snapshot.  Consider even applying the patch
the patch Markus put out for turn blocking I/O back on.  This is kinda a
seperate issue.  I can show this problem exists independent of his patch.

But your right.  This does not solve protocol 1 hang on exit.  It just
solves protocol 2 which is a hint that it's the wrong solution.

I must point out that this 'work around' is only required for a LIMITED
number of platforms.  Which I believe is HP/UX and Linux at this point.
Which leads me to believe their is something unique to those platforms.
So it may cause failure on platforms that don't require this work around.

My fear is by putting this into the CVS tree even the portable version
only that we will end up with another 2.3.0pX feasco.  Where we suddenly
learned what the downfall of the patch is months after the patch is
applied and almost forgotten about.

I'm still not sure this the correct solution to the problem.  It may look
like it's working, but so did the last hack.

- Ben




More information about the openssh-unix-dev mailing list