OpenSSH 2.3.0p1: Broken pipe / SIGPIPE

Andreas M. Kirchwitz amk at krell.zikzak.de
Tue Dec 12 09:56:22 EST 2000


Dear OpenSSH gurus! ;-)

I recently upgraded from "OpenSSH 2.1.1p4" to "OpenSSH 2.3.0p1"
on my Linux 2.2.17 box with OpenSSL 0.9.5a (RedHat 7.0).

According to the "ChangeLog", there was a change in SIGPIPE
handling:

 | 20000930
 |  [...]
 |  - (djm) Ignore SIGPIPEs from serverloop to child. Fixes crashes with
 |    very short lived X connections. Bug report from Tobias Oetiker 
 |    <oetiker at ee.ethz.ch>. Fix from Markus Friedl <markus at cvs.openbsd.org>

I don't know what it fixes for X, but it breaks pipe handling in
some other ways.

While "yes | head -1" worked okay with OpenSSH 2.1.1p4, it hangs
with tcsh 6.10.00 and OpenSSH 2.3.0p1 due to the ignored SIGPIPE
in the serverloop. With bash 2.04.11 and OpenSSH 2.3.0p1,
"yes | head -1" says "Broken pipe".

It works okay with OpenSSH 2.3.0p1 if I disable the two signal()
calls (in serverloop.c) that ignore SIGPIPE.

Another example is to call something like "grep foobar file | less"
on a file with thousands of occurences of "foobar". After "less"
has displayed the first page, if I then hit "q" (for quit), I get
thousands of lines saying:

	grep: writing output: Broken pipe

With OpenSSH 2.1.1p4, everything was fine.

Well, I don't say, that OpenSSH is broken... although the bad behaviour
obviously came from a change to OpenSSH (see ChangeLog). But even if
it's not OpenSSH's fault, maybe you have an idea what's wrong with the
other applications like tcsh, bash, head, less etc.

Any help is welcome! ;-)

	Greetings, Andreas





More information about the openssh-unix-dev mailing list