Date: Sat, 3 Mar 2001 19:18:05 -0800 From: Don Lewis <Don.Lewis@tsc.tdk.com> To: Cy Schubert - ITSD Open Systems Group <Cy.Schubert@uumail.gov.bc.ca>, Mike Tancsa <mike@sentex.net> Cc: stable@FreeBSD.org Subject: Re: more strange problem with broken pipes and ssh Message-ID: <200103040318.TAA25378@salsa.gv.tsc.tdk.com> In-Reply-To: <200103021433.f22EXHS61992@cwsys.cwsent.com> References: <200103021433.f22EXHS61992@cwsys.cwsent.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mar 2, 6:32am, Cy Schubert - ITSD Open Systems Group wrote: } Subject: Re: more strange problem with broken pipes and ssh } In message <5.0.2.1.0.20010226143727.024d0c90@marble.sentex.ca>, Mike } Tancsa wr } ites: } > } > OK, here is another strange problem with SSH and pipes. When connecting } > via some means other than ssh, the commands } > } > grep reject /var/log/maillog | less } > } > displays data as expected. However, when connected via ssh, hitting q to } > exit from less, I get a whole mess of } > } > grep: writing output: Broken pipe } > grep: writing output: Broken pipe } > grep: writing output: Broken pipe } > grep: writing output: Broken pipe } > } > This is with stable as of today and the problem showed up since the last } > ssh commits. The amount of broken pipes seems to scale with the amount of } > data less has, and it seems you need at least more than a screen full. } } I'm using -stable as of Feb 27 04:15 PST. No problems here. Is there } something in your ssh config that might either cause this bug to } manifest itself? I'm seeing this problem with makewhatis. I believe the problem is that sshd is setting the SIGPIPE handler to SIG_IGN, so when you run a pipeline of processes and the reader exits early, the writer gets an EPIPE error instead of getting silently killed with a SIGPIPE. I believe the fix is to call "signal(SIGPIPE, SIG_DFL)" in do_exec_pty() in session.c. I wonder if this problem might be shell dependent. Maybe some shells reset SIGPIPE to SIG_DFL and some don't modify whatever they inherit. I'm seeing the problem with csh. What shells are everyone else running? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103040318.TAA25378>