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/5476] New: fix stacksize overflow


I found a bug about the thread stack size overflow.

Here are procedures to reproduce this bug:

------------------------------------------
[root@localhost Temp]# cat test.c
#include <pthread.h>
#include <stdio.h>

int main(void)
{
	size_t stacksize;
	pthread_attr_t attr;

	pthread_attr_init(&attr);

	pthread_attr_getstacksize(&attr, &stacksize);

	printf("%lu\n", (unsigned long)stacksize);

	return 0;
}
----------------------------------------------------

[root@localhost Temp]# gcc -o test test.c -lpthread
[root@localhost Temp]# ulimit -s 1024
[root@localhost Temp]# ulimit -s
1024
[root@localhost Temp]# ./test
1048576
[root@localhost Temp]# ulimit -s $(( 0xffffffff / 1024 ))
[root@localhost Temp]# ulimit -s
4194303
[root@localhost Temp]# ./test
0

-- 
           Summary: fix stacksize overflow
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
        AssignedTo: drepper at redhat dot com
        ReportedBy: wangf at cn dot fujitsu dot com
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=5476

------- 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]