RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1902021 - postinstall scripts print scary "find: Broken pipe" messages
Summary: postinstall scripts print scary "find: Broken pipe" messages
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: microcode_ctl
Version: 8.3
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: 8.0
Assignee: Eugene Syromiatnikov
QA Contact: Jeff Bastian
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-26 15:30 UTC by Renaud Métrich
Modified: 2023-12-15 20:09 UTC (History)
5 users (show)

Fixed In Version: microcode_ctl-20201112-2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 14:54:31 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 5604051 0 None None None 2020-11-26 15:46:27 UTC

Description Renaud Métrich 2020-11-26 15:30:26 UTC
Description of problem:

When updating or reinstalling "microcode_ctl", the following stderr messages are often seen, which can confuse customers:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
  Running scriptlet: microcode_ctl-4:20200609-2.20201027.1.el8_3.x86_64                                                       1/2 
/usr/bin/find: ‘standard output’: Broken pipe
/usr/bin/find: write error
/usr/bin/find: ‘standard output’: Broken pipe
/usr/bin/find: write error

...
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

The issue is due to having the following piece of code in /usr/libexec/microcode_ctl/check_caveats:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
631                         { /usr/bin/find "$MC_CAVEATS_DATA_DIR/$cfg" \
632                                 -path "$MC_CAVEATS_DATA_DIR/$cfg/$p" -print0;
633                           /bin/true; } \
634                             | /bin/grep -zFxq "$cpu_mc_path" \
635                             || continue
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

From above, a "find" command is piped to a "grep -q" command.
Due to using "grep -q", the command will exit as soon as there is a match of the pattern, not waiting for reading the rest of the content received from standard input (i.e. the "find" command output).

Due to this, when "find" sends more output, the write() syscall returns with EPIPE error and makes "find" print the error message.

I know it's harmless but this kind of messages should be avoided. The solution here is likely to redirect stderr for "find" to /dev/null.


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

microcode_ctl-20200609-2.20201027.1.el8_3.x86_64


How reproducible:

90% of the time on a system with more than 1 kernel installed

Steps to Reproduce:

1. "yum -y reinstall microcode_ctl"


Expected results:

No "find" stderr messages


Additional info:

The reason for this is %postinstall scriptlet executes with SIGPIPE ignored, as seen in the strace excerpt below:

We have "find" (PID 1893564), forked by PID 1893562, forked by PID 1893547, forked by PID 1890437, the latter ignoring SIGPIPE:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
1893564 08:09:58.994098 execve("/usr/bin/find", ["/usr/bin/find", "/usr/share/microcode_ctl/ucode_with_caveats/intel", "-path", "/usr/share/microcode_ctl/ucode_with_caveats/intel/intel-ucode/*", "-print0"], ...
1893547 08:09:58.983373 clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fb051fc6a10) = 1893562 <0.000103>
1890437 08:09:58.849811 clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fa283820a10) = 1893547 <0.000088>
1890437 08:09:21.144397 rt_sigaction(SIGPIPE, {sa_handler=SIG_DFL, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fa459938880}, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fa45a460b20}, 8) = 0 <0.000015>
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

PID 1890437 being the shell script executing the %postinstall script:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
1890437 08:09:21.148698 execve("/bin/sh", ["/bin/sh", "/var/tmp/rpm-tmp.pphSgk", "2"], ...
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Comment 1 Eugene Syromiatnikov 2020-11-26 18:12:42 UTC
See also bug 1781365; I wonder now if the efficiency gains of grep -q are worth all the hassle as well as hiding other possible find-induced error messages.

Comment 2 Eugene Syromiatnikov 2020-11-26 18:14:49 UTC
(In reply to Eugene Syromiatnikov from comment #1)
> See also bug 1781365

Or, more specifically, bug 1781332.

Comment 14 errata-xmlrpc 2021-05-18 14:54:31 UTC
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 (microcode_ctl bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1613


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