Bug 177242 - Bash is not ignoring SIGPIPE
Summary: Bash is not ignoring SIGPIPE
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-01-08 05:05 UTC by Brian Gerst
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-01-10 14:27:52 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Brian Gerst 2006-01-08 05:05:35 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8) Gecko/20060103 Fedora/1.5-4 Firefox/1.5

Description of problem:
According to the bash FAQ:
As of bash-3.1, bash will not report SIGPIPE errors by default.  You
can build a version of bash that will report such errors.

But it is still displaying errors:
cg-log: line 210: echo: write error: Broken pipe


Version-Release number of selected component (if applicable):
bash-3.1-2

How reproducible:
Always

Steps to Reproduce:
1. Use the cogito command, cg-log, which invokes less
2. The error shows when you exit less.
  

Actual Results:  cg-log: line 210: echo: write error: Broken pipe


Expected Results:  No error.

Additional info:

Comment 1 Tim Waugh 2006-01-09 14:46:23 UTC
Please provide a smaller, self-contained test case.  I haven't been able to
reproduce this.

while :; do echo foo; done | head -n1

..generates a SIGPIPE, and does not give out a warning.  What does that line do
when you run it?

Comment 2 Brian Gerst 2006-01-09 15:11:29 UTC
I found the culprit.  cg-log does "trap exit SIGPIPE".  Commenting out this line
silences the error.  Since older bashes didn't give the error message with this
trap in place, is it a bash regression, or should the script just not use the trap?

Comment 3 Tim Waugh 2006-01-09 15:48:29 UTC
Reported upstream.  Thanks for the smaller test case:

bash -c 'trap exit SIGPIPE; echo foo' | :

Comment 4 Tim Waugh 2006-01-10 14:27:52 UTC
Intentional behaviour change.


Note You need to log in before you can comment on or make changes to this bug.