This is sources Bugzilla
Bugzilla Version 2.17.5
Bugzilla Bug 5476
  fix stacksize overflow Last modified: 2007-12-12 17:51
     Query page      Enter new bug
Bug#: 5476   Hardware:   Reporter: wang fang <wangf@cn.fujitsu.com>
Host: Target: Build:
Product:     Add CC:
Component:   Version:   CC:
Remove selected CCs
Status: RESOLVED   Priority:  
Resolution: WONTFIX   Severity:  
Assigned To: Ulrich Drepper <drepper@redhat.com>   Target Milestone:  
Flags: Requestee:
  backport ()
  examined ()
  testsuite ()
Summary:
Keywords:

Attachment Description Type Created Actions
stacksize overflow.patch patch to fix the bug patch 2007-12-12 09:55 Edit | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 5476 depends on: Show dependency tree
Show dependency graph
Bug 5476 blocks:

Additional Comments:


Leave as RESOLVED WONTFIX
Reopen bug
Mark bug as VERIFIED

View Bug Activity   |   Format For Printing


Description:   Last confirmed: 0000-00-00 00:00 Opened: 2007-12-12 09:52
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

------- Additional Comment #1 From wang fang 2007-12-12 09:55 -------
Created an attachment (id=2133)
patch to fix the bug

------- Additional Comment #2 From Ulrich Drepper 2007-12-12 17:51 -------
This is a user bug.  I'm not going to add code to prevent the user from shooting
herself/himself in the foot.  Maybe sometimes it's useful.  There is a clearly
documented minimum stack size.  If it is not followed bad things can happen. 
So, don't do it.

     Query page      Enter new bug
Actions: New | Query | bug # | Reports | Requests   New Account | Log In