This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/6976] New: allocated thread stack size can be less than requested stack size


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]