public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/6976] New: allocated thread stack size can be less than requested stack size
@ 2008-10-24 2:01 mtk dot manpages at gmail dot com
2008-10-24 2:02 ` [Bug nptl/6976] " mtk dot manpages at gmail dot com
0 siblings, 1 reply; 2+ messages in thread
From: mtk dot manpages at gmail dot com @ 2008-10-24 2:01 UTC (permalink / raw)
To: glibc-bugs
For pthread_attr_setstacksize(), POSIX.1-2001 says:
"The stacksize attribute shall define the minimum stack size (in bytes)
allocated for the created threads stack."
However, under NPTL, the allocated stack (as reported by pthread_getattr_np())
can be up to [STACK_MIN - 1] (15 on x86-32) bytes less than was requested.
The problem line looks to be the following line in nptl/allocatestak.c:
size &= ~__static_tls_align_m1;
which should probably be something like:
size = (size + __static_tls_align_m1 + 1) & ~__static_tls_align_m1;
--
Summary: allocated thread stack size can be less than requested
stack size
Product: glibc
Version: 2.8
Status: NEW
Severity: normal
Priority: P2
Component: nptl
AssignedTo: drepper at redhat dot com
ReportedBy: mtk dot manpages at gmail dot com
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=6976
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug nptl/6976] allocated thread stack size can be less than requested stack size
2008-10-24 2:01 [Bug nptl/6976] New: allocated thread stack size can be less than requested stack size mtk dot manpages at gmail dot com
@ 2008-10-24 2:02 ` mtk dot manpages at gmail dot com
0 siblings, 0 replies; 2+ messages in thread
From: mtk dot manpages at gmail dot com @ 2008-10-24 2:02 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From mtk dot manpages at gmail dot com 2008-10-24 02:01 -------
Created an attachment (id=3021)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=3021&action=view)
test program
The attached program can be used to test. Here's some examples:
$ uname -i
i386
$ ./a.out 0x400f
Attributes of created thread:
Stack address = 0xb7fe6000 (EOS = 0xb7fea000)
Stack size = 0x4000 (16384) bytes
$ ./a.out 0x5161f
Attributes of created thread:
Stack address = 0xb7d7c000 (EOS = 0xb7dcd610)
Stack size = 0x51610 (333328) bytes
--
http://sourceware.org/bugzilla/show_bug.cgi?id=6976
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-24 2:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-24 2:01 [Bug nptl/6976] New: allocated thread stack size can be less than requested stack size mtk dot manpages at gmail dot com
2008-10-24 2:02 ` [Bug nptl/6976] " mtk dot manpages at gmail dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).