Bug 1984800

Summary: stress-ng: FTBFS due to dynamic PTHREAD_STACK_MIN (glibc 2.34 related) - rebase
Product: Red Hat Enterprise Linux 9 Reporter: Florian Weimer <fweimer>
Component: stress-ngAssignee: John Kacur <jkacur>
Status: CLOSED CURRENTRELEASE QA Contact: Kernel Realtime QE <rt-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: CentOS StreamCC: bhu, bstinson, jkacur, jwboyer, msimmons, mstowell
Target Milestone: betaKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: stress-ng-0.13.00-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-07 21:18:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1984799    
Bug Blocks:    

Description Florian Weimer 2021-07-22 09:28:21 UTC
Quoting Carlos from the upstream ticket:

“
Upstream glibc 2.34 will release with a non-constant value of PTHREAD_STACK_MIN. This is because hardware vendors like Intel and Arm want to have scalable vector extensions whose size can no longer be determined at compile time. The minimum thread stack size in almost all cases has been really too small. By switching to sysconf we can directly pipe the kernel's expected minimum stack size to the process. This will need to be fixed in stress-ng. If you need help writing the change please reach out!
”

The error looks like this:

CC stress-pthread.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 stress-ng.h:50,
                 from stress-pthread.c:25:
stress-pthread.c: In function 'stress_pthread':
stress-pthread.c:403:26: error: missing binary operator before token "("
  403 | #if DEFAULT_STACK_MIN == PTHREAD_STACK_MIN
      |                          ^~~~~~~~~~~~~~~~~
In file included from stress-pthread.c:25:
stress-ng.h:844:35: warning: comparison of integer expressions of different signedness: 'long long unsigned int' and 'long int' [-Wsign-compare]
  844 | #define STRESS_MAXIMUM(a,b) (((a) > (b)) ? (a) : (b))
      |                                   ^
stress-pthread.c:406:35: note: in expansion of macro 'STRESS_MAXIMUM'
  406 |         const size_t stack_size = STRESS_MAXIMUM(DEFAULT_STACK_MIN, PTHREAD_STACK_MIN);
      |                                   ^~~~~~~~~~~~~~
stress-ng.h:844:50: warning: operand of '?:' changes signedness from 'long int' to 'long long unsigned int' due to unsignedness of other operand [-Wsign-compare]
  844 | #define STRESS_MAXIMUM(a,b) (((a) > (b)) ? (a) : (b))
      |                                                  ^~~
stress-pthread.c:406:35: note: in expansion of macro 'STRESS_MAXIMUM'
  406 |         const size_t stack_size = STRESS_MAXIMUM(DEFAULT_STACK_MIN, PTHREAD_STACK_MIN);
      |                                   ^~~~~~~~~~~~~~
make[1]: *** [Makefile:372: stress-pthread.o] Error 1