Bug 2502638

Summary: posix_spawn_file_actions_addchdir replacement becomes an infinite loop with glibc 2.44 prerelease header-only POSIX alias
Product: [Fedora] Fedora Reporter: Jason Montleon <jason>
Component: glibcAssignee: Carlos O'Donell <codonell>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: arjun, codonell, david.abdurachmanov, dj, dominik, fberat, fweimer, jlaw, josmyers, lemenkov, mcermak, mcoufal, mfabian, pfrankli, rjones, sergio, sipoyare, skolosov, suraj.ghimire7
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
URL: https://sourceware.org/bugzilla/show_bug.cgi?id=34437
Whiteboard:
Fixed In Version: gnulib-0-60.20260801git9748dc4.fc45 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2026-08-03 20:59:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2485708    

Description Jason Montleon 2026-07-19 19:06:41 UTC
Since glibc commit 7594b4e ("posix: Add POSIX aliases to some spawn functions", Lucas Chollet, committed to master 2026-04-07 during the 2.44 development cycle) tests are failing, hanging until the build is cancelled for at least m4, gettext, and gnulib.

This commit is included in Fedora since glibc-2.43.9000-9.fc45

To reproduce you can do as little as:
```
cat << EOF > test.c
#include <spawn.h>
 
int
posix_spawn_file_actions_addchdir (posix_spawn_file_actions_t *fa,
                                   const char *path)
{
  return posix_spawn_file_actions_addchdir_np (fa, path);
}
 
int
main (void)
{
  posix_spawn_file_actions_t fa;
  posix_spawn_file_actions_init (&fa);
  return posix_spawn_file_actions_addchdir (&fa, "/");
}
EOF
 
gcc -D_GNU_SOURCE -O2 -o test test.c && ./test
```

Without `-D_GNU_SOURCE -O2` you will not see a problem.

_USE_XOPEN2K24XSI is only defined when _XOPEN_SOURCE >= 800, and _GNU_SOURCE implies _XOPEN_SOURCE 800. With -O2 it hangs, otherwise it crashes.

Reproducible: Always

Steps to Reproduce:
1. Try to build m4, gettext, or gnulib in rawhide
2. Observe that tests hang and never complete
Actual Results:
Test hang

Expected Results:
Tests complete

Additional Information:
I have not found any reports or fixes against glibc, gnulib, m4, or gettext upstream, only a report against gnulib at https://bugzilla.redhat.com/show_bug.cgi?id=2485708

We have observed the m4, gettext, and gnulib builds hanging on https://riscv-kojipkgs.fedoraproject.org/koji/ but it appears they also did on the main koji during the mass rebuild.

Comment 1 Sergio Basto 2026-07-23 01:25:26 UTC
I updated Gnulib to the stable-202607 branch and the latest git snapshot, but we are still unable to complete the test suite. 

The Fedora Koji build consistently hangs after PASS: test-error.sh:
https://koji.fedoraproject.org/koji/taskinfo?taskID=148168073

This appears to be the same infinite loop issue described in this bug

Comment 2 Peter Lemenkov 2026-08-03 20:59:37 UTC
I've just finished building a gnulib-0-57.20260302git4a3650d.fc45 which contains all the fixes required.

Comment 3 Peter Lemenkov 2026-08-03 21:03:49 UTC
Sorry I meant gnulib-0-60.20260801git9748dc4.fc45 of course