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 1538776 - Continue to support threads using PTHREAD_STACK_MIN incorrectly.
Summary: Continue to support threads using PTHREAD_STACK_MIN incorrectly.
Keywords:
Status: CLOSED DUPLICATE of bug 1527904
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.4
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: glibc team
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-25 19:44 UTC by Paulo Andrade
Modified: 2021-03-11 17:01 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-29 16:21:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Paulo Andrade 2018-01-25 19:44:38 UTC
This should be a known issue, as it is corrected with glibc-2.17-221.el7,
but the later is not yet available to customers.
The issue should be the backport of
https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b52b0d793dcb226ecb0ecca1e672ca265973233c
and the latest patches (glibc-2.17-221.el7) appear to correct it.

Comment 3 Florian Weimer 2018-01-25 19:56:13 UTC
Is LD_BIND_NOW=1 a suitable workaround?  Disabling lazy binding avoids the dynamic linker trampoline, and thus its extended stack usage.

Comment 4 Paulo Andrade 2018-01-25 20:04:24 UTC
For the moment I told the user to downgrade to glibc-2.17-196.el7
I will also suggest LD_BIND_NOW=1

Comment 6 Carlos O'Donell 2018-01-25 20:20:17 UTC
(In reply to Paulo Andrade from comment #0)
> This should be a known issue, as it is corrected with glibc-2.17-221.el7,
> but the later is not yet available to customers.
> The issue should be the backport of
> https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;
> h=b52b0d793dcb226ecb0ecca1e672ca265973233c
> and the latest patches (glibc-2.17-221.el7) appear to correct it.

The issue is more complicated than this.

Customers have used PTHREAD_STACK_MIN incorrectly over the years. The minimum stack is only guaranteed to start the thread, and nothing else. All other allocations required by the thread function must be added to the minimum stack. We have seen two cases now where small-stack threads have failed because they did not include enough stack space and instead used PTHREAD_STACK_MIN, hoping there would be enough slack there to allow them to operate. In particular, pthread_cancel() is not guaranteed to complete in a PTHREAD_STACK_MIN sized stack.

Having said this, we will be fixing this issue in RHEL 7.5, using a two-pronged strategy, first by changing some of the accounting for guard pages, and second by shifting some of the normal pthread_cancel() work back to the dynamic loader. Those two options should be enough to allow existing RHEL 7.5 applications like those in the example, to keep running. We do this because we value stability and backwards compatibility in RHEL. However, this should be a warning to application authors that they have relied upon leftover space in PTHREAD_STACK_MIN to run their thread routines, and that is not a guaranteed assumption. That leftover space belongs to the implementation to use.

Comment 8 Florian Weimer 2018-01-29 16:21:55 UTC

*** This bug has been marked as a duplicate of bug 1527904 ***


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