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 2177235 - 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 9
Classification: Red Hat
Component: glibc
Version: 9.2
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Florian Weimer
QA Contact: Sergey Kolosov
Jacob Taylor Valdez
URL:
Whiteboard:
Depends On:
Blocks: 2176707 2188641
TreeView+ depends on / blocked
 
Reported: 2023-03-10 14:17 UTC by Arjun Shankar
Modified: 2023-11-07 10:11 UTC (History)
13 users (show)

Fixed In Version: glibc-2.34-67.el9
Doc Type: Bug Fix
Doc Text:
.The `glibc` `system()` function now restores the previous signal mask unconditionally Previously, if the `glibc` `system()` function was called concurrently from multiple threads, the signal mask for the `SIGCHLD` signal might not be restored correctly. As a consequence, the `SIGCHLD` signal remained blocked after the return from the `glibc` `system()` function on some threads. With this update, the `glibc` `system()` function now restores the previous signal mask unconditionally, even when parallel `system()` function calls are running. As a result, the `SIGCHLD` signal is no longer incorrectly blocked if the `glibc` `system()` function is called concurrently from multiple threads.
Clone Of: 2176707
Environment:
Last Closed: 2023-11-07 08:37:47 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-151441 0 None None None 2023-03-10 14:18:49 UTC
Red Hat Product Errata RHBA-2023:6582 0 None None None 2023-11-07 08:38:17 UTC
Sourceware 30163 0 P2 RESOLVED system() erroneously block SIGCHLD forever when called concurrently 2023-03-10 14:39:04 UTC

Description Arjun Shankar 2023-03-10 14:17:32 UTC
+++ This bug was initially created as a clone of Bug #2176707 +++

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 2 Florian Weimer 2023-04-28 11:19:48 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 Jacob Taylor Valdez 2023-08-01 10:11:56 UTC
setting r_d_t

Comment 10 errata-xmlrpc 2023-11-07 08:37:47 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:6582


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