[Pkg-xfce-devel] Bug#733722: xfce4-terminal: doesn't reset SIGPIPE before spawing a shell (was: coreutils: ls -l | head sometimes dies with a broken pipe)

Julian Gilbey jdg at debian.org
Sun Jan 5 19:16:47 UTC 2014


On Sun, Jan 05, 2014 at 07:18:24PM +0100, Yves-Alexis Perez wrote:
> > (xfce4-terminal maintainer: please see the original report for a
> > slightly longer explanation of the bug)
> 
> Note that if you don't CC: us manually, we won't get it.

I bcc'd xfce4-terminal at packages.debian.org; it was held up in a
moderation queue.

> > So I get that SIGPIPE is being ignored.  The process tree is:
> > 
> > init -> gdm3 -> gdm-simple-slave -> gdm-session-worker -> sh ->
> >   xfce4-session -> xfce4-panel -> xfce4-terminal -> bash
> > 
> > So it's somewhere in that mix, and I've tracked it down to
> > xfce4-terminal (because running the ls | head commands in an xterm
> > instead of in xfce4-terminal works just fine).
> > 
> > And in xfce4-terminal, line 172 of terminal/main.c (the first line of
> > code executed by xfce4-terminal!) reads:
> > 
> >   signal (SIGPIPE, SIG_IGN);
> > 
> > and this is never undone.  This was introduced in xfce4-terminal
> > version 0.2.5.8rc2 (fixing xfce bug #2349), and we are currently at
> > 0.6.2-4, so I'm not sure why I'm the first one to notice this
> > problematic behaviour.
> 
> I'm running 0.6.3-1 but I don't think anything relevant changed since
> 0.6.2, and:
> 
> corsac at scapa:~$ trap
> trap -- '' SIGTSTP
> trap -- '' SIGTTIN
> trap -- '' SIGTTOU
> corsac at scapa:~$ yes | head -n1
> y
> 
> (this is with bash, trap doesn't return anything with zsh).

That's really, really bizarre.  I wonder what was different on my
machine.  (Incidentally, I've now tried this on a different machine,
and it also doesn't exhibit the same broken behaviour.  That's even
weirder.)  And rebooting the machine didn't change the behaviour.

> > Anyway, a proposed bug-fix is attached: the signal handler is reset
> > before the shell process is forked.  There is also another tiny bugfix
> > in this patch: since the #include <signal.h> is enclosed within an
> > #ifdef HAVE_SIGNAL_H clause, I've enclosed the call to signal() within
> > a similar clause in main.c.
> 
> I'll wait for upstream comment on this.
> 
> Thanks for the report anyway.

Pleasure!

   Julian



More information about the Pkg-xfce-devel mailing list