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 2176707 - glibc: system() erroneously block SIGCHLD forever when called concurrently
Summary: glibc: system() erroneously block SIGCHLD forever when called concurrently
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: glibc
Version: 8.7
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: rc
: 8.9
Assignee: DJ Delorie
QA Contact: Martin Coufal
URL:
Whiteboard:
Depends On: 2177235
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-09 02:59 UTC by Adam Yi
Modified: 2023-11-14 18:03 UTC (History)
9 users (show)

Fixed In Version: glibc-2.28-233.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 2177235 (view as bug list)
Environment:
Last Closed: 2023-11-14 15:49:05 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Reproduction (678 bytes, text/x-csrc)
2023-03-09 02:59 UTC, Adam Yi
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2065588 0 unspecified CLOSED glibc: Multithreaded process crash when calling popen() [rhel-8.7.0] 2023-07-18 14:30:35 UTC
Red Hat Issue Tracker RHELPLAN-151176 0 None None None 2023-03-09 02:59:59 UTC
Red Hat Product Errata RHBA-2023:7107 0 None None None 2023-11-14 15:49:34 UTC
Sourceware 30163 0 P2 RESOLVED system() erroneously block SIGCHLD forever when called concurrently 2023-03-09 02:59:27 UTC

Description Adam Yi 2023-03-09 02:59:27 UTC
Created attachment 1949201 [details]
Reproduction

We backported a buggy commit (5fb7fc96350575c9adb1316833e48ca11553be49) in bug 2065588 that landed in glibc-2.28-211.

Specifically, in the following scenario with two threads in the same process:

1. Thread A calls system but hasn't returned yet
2. Thread B calls another system but returns

I observed that SIGCHLD would be blocked forever in thread B after its system() returns, even after the system() in thread A returns (though I believe it should unblock it after system() in thread B returns). This was not the case before this patch.

I've attached a simple C reproduction program to this bug. It doesn't print anything on previously but prints "SIGCHLD is erroneously blocked" with glibc-2.28-211.

I filed this bug upstream (sourceware bug 30163) and this is fixed in upstream in 436a604b7dc741fc76b5a6704c6cd8bb178518e7. Can we backport the fix as well?

Comment 1 Florian Weimer 2023-03-10 14:19:27 UTC
Thank you for filing this bug for tracking purposes. We are considering fixing it in a future minor release of Red Hat Enterprise Linux 8. If you have specific timeline requirements for the fix, please file a customer support ticket in Customer Portal at: https://access.redhat.com/support/cases/

Comment 2 Florian Weimer 2023-04-28 11:19:29 UTC
Upstream fix:

commit 436a604b7dc741fc76b5a6704c6cd8bb178518e7
Author: Adam Yi <ayi>
Date:   Tue Mar 7 07:30:02 2023 -0500

    posix: Fix system blocks SIGCHLD erroneously [BZ #30163]
    
    Fix bug that SIGCHLD is erroneously blocked forever in the following
    scenario:
    
    1. Thread A calls system but hasn't returned yet
    2. Thread B calls another system but returns
    
    SIGCHLD would be blocked forever in thread B after its system() returns,
    even after the system() in thread A returns.
    
    Although POSIX does not require, glibc system implementation aims to be
    thread and cancellation safe. This bug was introduced in
    5fb7fc96350575c9adb1316833e48ca11553be49 when we moved reverting signal
    mask to happen when the last concurrently running system returns,
    despite that signal mask is per thread. This commit reverts this logic
    and adds a test.
    
    Signed-off-by: Adam Yi <ayi>
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella>

Comment 8 errata-xmlrpc 2023-11-14 15:49:05 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 (glibc 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-2023:7107


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