Bug 1527904 - glibc: PTHREAD_STACK_MIN is too small on x86-64
Summary: glibc: PTHREAD_STACK_MIN is too small on x86-64
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Carlos O'Donell
QA Contact: Sergey Kolosov
: 1538776 (view as bug list)
Depends On: 1527905
TreeView+ depends on / blocked
Reported: 2017-12-20 12:27 UTC by Florian Weimer
Modified: 2018-04-10 14:04 UTC (History)
9 users (show)

Fixed In Version: glibc-2.17-221.el7
Doc Type: Bug Fix
Doc Text:
Applications with PTHREAD_STACK_MIN sized thread stacks may experience segmentation faults as those threads run out of stack space. Such applications have incorrectly expected PTHREAD_STACK_MIN to provide enough stack space to do more than just start the thread. Applications should add to PTHREAD_STACK_MIN the stack required for their own uses. As an intermediate solution to allow existing applications to continue to operate the C runtime has been adjusted to use less stack space for key functionality. Existing applications should now continue to operate with PTHREAD_STACK_MIN sized thread stacks.
Clone Of: 1527887
Last Closed: 2018-04-10 14:04:32 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1499012 unspecified CLOSED glibc: Restore compatibility with compilers which use vector registers for argument passing against x86-64 ABI 2020-10-14 00:28:05 UTC
Red Hat Bugzilla 1504969 high CLOSED glibc: Use XSAVE/XSAVEC in dynamic loader lazy resolution to support more calling conventions. 2020-10-14 00:28:05 UTC
Red Hat Product Errata RHSA-2018:0805 None None None 2018-04-10 14:04:52 UTC
Sourceware 22636 P2 RESOLVED PTHREAD_STACK_MIN is too small on x86-64 2020-10-05 05:23:09 UTC

Internal Links: 1499012 1504969

Description Florian Weimer 2017-12-20 12:27:19 UTC
Bug 1527887 shows that PTHREAD_STACK_MIN is really low on x86-64 (at 16384) and cannot accommodate both a signal handler frame, the libgcc unwinder, and an ld.so trampoline on AVX-512 (where the XSAVE area is around 2.5 KiB, and it is needed twice on the stack).

We should investigate ways how we can make for of those 16 KiB usable from applications.  At the very list, if the application requests a 16 KiB stack, it should get as much stack space as indicated, and not just 8 KiB.

Comment 1 Florian Weimer 2017-12-20 13:50:28 UTC
This is a regression introduced by glibc-2.17-196.el7_4.2 in <https://access.redhat.com/errata/RHBA-2017:3296>.

Comment 7 Florian Weimer 2018-01-29 16:21:55 UTC
*** Bug 1538776 has been marked as a duplicate of this bug. ***

Comment 11 errata-xmlrpc 2018-04-10 14:04:32 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, and where to find the updated
files, follow the link below.

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


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