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 1984813 - autofs: FTBFS due to dynamic PTHREAD_STACK_MIN (glibc 2.34 related)
Summary: autofs: FTBFS due to dynamic PTHREAD_STACK_MIN (glibc 2.34 related)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: autofs
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta
: ---
Assignee: Ian Kent
QA Contact: Kun Wang
URL:
Whiteboard:
Depends On: 1984808
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-22 09:41 UTC by Florian Weimer
Modified: 2021-12-07 21:47 UTC (History)
3 users (show)

Fixed In Version: autofs-5.1.7-23.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1984808
Environment:
Last Closed: 2021-12-07 21:44:43 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Florian Weimer 2021-07-22 09:41:22 UTC
+++ This bug was initially created as a clone of Bug #1984808 +++

Building autofs fails with:

gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_REENTRANT -D_FILE_OFFSET_BITS=64 -I/usr/include/tirpc  -D_REENTRANT -D_FILE_OFFSET_BITS=64 -I/usr/include/tirpc  -rdynamic -fPIE -D_GNU_SOURCE -I../include -DAUTOFS_LIB_DIR=\"/usr/lib64/autofs\"  -DAUTOFS_MAP_DIR=\"/etc\" -DAUTOFS_CONF_DIR=\"/etc/sysconfig\" -DAUTOFS_FIFO_DIR=\"/run\" -DAUTOFS_FLAG_DIR=\"/run\" -DVERSION_STRING=\"5.1.7-18.fc35\" -DWITH_SYSTEMD -I/usr/include/libxml2  -c automount.c
In file included from /usr/include/bits/local_lim.h:81,
                 from /usr/include/bits/posix1_lim.h:161,
                 from /usr/include/dirent.h:233,
                 from automount.c:22:
automount.c:87:37: error: initializer element is not constant
   87 | size_t detached_thread_stack_size = PTHREAD_STACK_MIN * 144;
      |                                     ^~~~~~~~~~~~~~~~~
make[1]: Leaving directory '/builddir/build/BUILD/autofs-5.1.7/daemon'

This use of PTHREAD_STACK_MIN is a bit strange because the computed stack size varies wildly between architectures. And it was done deliberately to *increase* stack size (most uses of PTHREAD_STACK_MIN intend to do the opposite):

commit ef4886702177f1bbeba66858181a7db44ca8ebd6
Author: Ian Kent <raven>
Date:   Fri Apr 21 08:17:52 2017 +0800

    autofs-5.1.2 - increase worker thread per-thread stack size
    
    automount(8) uses a worker thread per-thread stack size of 1M which is
    sufficient for its needs.
    
    But some glibc functions (such as nscd_getgr_r()) use alloca() to allocate
    working storage that can have an arbitary size. Since alloca() never fails
    there is no way to check for stack overflow. This has been fixed in more
    recent versions of glibc.
    
    But for older version of glibc all that can be done by automount to avoid
    this is to increase the stack size.
    
    Signed-off-by: Ian Kent <raven>

Maybe this can be disabled for glibc 2.34 and later. Due to the symbol version changes in glibc 2.34, the compiled binary cannot run on earlier glibc versions, so a compile-time check would be safe in this case.

Comment 1 Ian Kent 2021-07-22 11:30:20 UTC
Right, I'll fix it in Rawhide first, ;)

Comment 4 Ian Kent 2021-07-30 07:25:31 UTC
The glibc functions that lead to autofs needing to use PTHREAD_STACK_MIN have
changed in glibc some time ago now.

So the original code that resulted in autofs needing this is now gone.

So there's no reason there should be any regressions due to this change.


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