Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
+++ 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.
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.