Created attachment 451728 [details]
Description of problem:
The ksh pipefail option does not wait for the pipeline to complete and can incorrectly report a failed exit status for a command like
ls -l /bin/ksh | ! grep -e junk
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. download and run the attached pipefail.ksh script
within approximately 1000 iterations of the loop, it will fail:
The script executed for 2.926 seconds while looping 370 times before failing.
Created attachment 451732 [details]
backported ksh patch
Siddhesh Poyarekar narrowed down the upstream changes between 20100811 and 20100924 found this patch solves the problem.
reproducible with 20100202
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
This request was erroneously denied for the current release of
Red Hat Enterprise Linux. The error has been fixed and this
request has been re-proposed for the current release.
Comment on attachment 451732 [details]
backported ksh patch
this patch does not work, it's causing regressions:
test basic.sh begins at 2011-03-14+13:20:37
basic.sh: pipefail causing /bin/true to wait for other end of pipe
test basic.sh failed at 2011-03-14+13:21:02 with exit code 1 [ 95 tests 1 error ]
Created attachment 484163 [details]
patch to fix this
not that different, I know, just one section missing. Despite we did not used it in version for which last patch was prepared, we need it now.
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
Previously, ksh did not always wait for a pipeline to complete when the pipefail option was used. Consequently, a failed exit status was erroneously reported even when the pipeline had not failed. With this update, the code has been improved and the pipefail option now functions as expected.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.