Bug 111920

Summary: pthread_attr_setstacksize failure.
Product: Red Hat Enterprise Linux 3 Reporter: Brett Johnson <brett.johnson>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 3.0CC: charline.polifka, tao
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-12-14 19:27:48 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:
Attachments:
Description Flags
Program to reproduce the problem none

Description Brett Johnson 2003-12-11 16:27:16 UTC
Description of problem:

  When the attached program is compiled and run on rhel3, it fails
with a "Error on pthread_attr_setstacksize: 22".  If it is compiled on
another platform (i.e. debian or SuSe), it runs fine on that platform,
and on rhel3.  If the executable is compiled on rhel3, and executed on
any other platform, it fails with "./stacksize: /lib/libpthread.so.0:
version `GLIBC_2.3.3' not found (required by ./stacksize)"  (Even
though the rhel3 version of glibc reported by rpm is 2.3.2).

Version-Release number of selected component (if applicable):

  2.3.2 or 2.3.3, it's not clear what version rhel3 ships...

How reproducible:

  Every time.

Steps to Reproduce:
1. Compile attached program (gcc -o stacksize -lpthread stacksize.c)
2. Run program
  
Actual results:

$ ./stacksize
Using thread stack size: 131072
pthread_attr_init done.
Error on pthread_attr_setstacksize: 22

Expected results:

$ ./stacksize
Using thread stack size: 131072
pthread_attr_init done.

Additional info:

Comment 1 Brett Johnson 2003-12-11 16:28:15 UTC
Created attachment 96471 [details]
Program to reproduce the problem

Comment 2 Larry Troan 2003-12-14 19:05:01 UTC
NOMINATING to U2 MUSTFIX list per Charline's note of 12/12/03.

JUSTIFICATION:
Not a acceptable bug.

Comment 3 Jakub Jelinek 2003-12-14 19:27:48 UTC
This is not a bug.  See
http://www.opengroup.org/onlinepubs/007904975/functions/pthread_attr_setstacksize.html
The pthread_attr_setstacksize() function shall fail if:
[EINVAL]
  The value of stacksize is less than {PTHREAD_STACK_MIN} or exceeds a system-imposed limit.

PTHREAD_STACK_MIN is 196608 on IA-64 (both linuxthreads and NPTL
headers define this value), so pthread_attr_setstacksize must return EINVAL
in your testcase.

PTHREAD_STACK_MIN used to be 16384 in the past on all Linux architectures
which obviously was a bug, on IA-64 that is even less than a page
(which is up to 64K), while at least a guard page, a stack page, some room
for thread stack address cache coloring and some room for backing
store is needed.  16384 is an appropriate value for 4K page size architectures
like IA-32.