Bug 111920 - pthread_attr_setstacksize failure.
Summary: pthread_attr_setstacksize failure.
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: glibc
Version: 3.0
Hardware: ia64
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2003-12-11 16:27 UTC by Brett Johnson
Modified: 2007-11-30 22:06 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-12-14 19:27:48 UTC
Target Upstream Version:

Attachments (Terms of Use)
Program to reproduce the problem (677 bytes, text/plain)
2003-12-11 16:28 UTC, Brett Johnson
no flags Details

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.

Not a acceptable bug.

Comment 3 Jakub Jelinek 2003-12-14 19:27:48 UTC
This is not a bug.  See
The pthread_attr_setstacksize() function shall fail if:
  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.

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