Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 177242 - Bash is not ignoring SIGPIPE
Bash is not ignoring SIGPIPE
Product: Fedora
Classification: Fedora
Component: bash (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2006-01-08 00:05 EST by Brian Gerst
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-01-10 09:27:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Brian Gerst 2006-01-08 00:05:35 EST
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):

How reproducible:

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 09:46:23 EST
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 10:11:29 EST
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 10:48:29 EST
Reported upstream.  Thanks for the smaller test case:

bash -c 'trap exit SIGPIPE; echo foo' | :
Comment 4 Tim Waugh 2006-01-10 09:27:52 EST
Intentional behaviour change.

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