! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfce4-terminal doesn't reset SIGPIPE before spawing a shell
Status:
RESOLVED: FIXED
Product:
Xfce4-terminal
Component:
General

Comments

Description Julian Gilbey 2014-01-04 21:25:36 CET
Created attachment 5298 
Patch to set SIGPIPE to SIG_DFL before spawning a shell

A fuller log of the problems this causes can be found at http://bugs.debian.org/733722
A brief summary: running a shell in an xfce4-terminal sometimes causes weird SIGPIPE errors, such as the following:

erdos:~ $ ls /media/JG-BACKUP/mythtv/recordings/ | head -n1
1001_20121224170300.mpg
ls: write error: Broken pipe

There is no reason for a broken pipe here!

It turns out that the cause is that xfce4-terminal sets SIGPIPE to be ignored (to fix https://bugzilla.xfce.org/show_bug.cgi?id=2349) but doesn't reset it to its default status before launching a shell.  The attached (and tested) patch does this, and it does not appear to reawaken the problem experienced in that bug.

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.
Comment 1 Julian Gilbey 2014-01-04 21:26:17 CET
(Actually, this also applies to 0.6.3, but there isn't an option to select that version.)
Comment 2 Julian Gilbey 2014-01-04 22:25:43 CET
Actually, on reflection, a better way of fixing this bug may be to restrict the SIGPIPE ignoring to only those situations where this is actually desired, so the cases listed in the now-fixed bug 2349.  But I haven't looked into how to code that up.
Comment 3 Egmont Koblinger 2016-06-19 10:21:02 CEST
vte3 fixed this at one point (and then further refactored in https://git.gnome.org/browse/vte/commit/?id=171b8aa).
Comment 4 Igor editbugs 2016-06-19 16:40:48 CEST
So should this one be resolved?
Comment 5 Egmont Koblinger 2016-06-19 19:02:40 CEST
I think so.
Comment 6 Igor editbugs 2016-06-19 19:32:35 CEST
Ok then, closing.

Bug #10602

Reported by:
Julian Gilbey
Reported on: 2014-01-04
Last modified on: 2016-06-19

People

Assignee:
Nick Schermer
CC List:
3 users

Version

Attachments

Patch to set SIGPIPE to SIG_DFL before spawning a shell (1.13 KB, application/octet-stream)
2014-01-04 21:25 CET , Julian Gilbey
no flags

Additional information