В Sat, 29 Jan 2011 16:50:11 -0500
Rich Felker <[email protected]> пишет:

> On Fri, Jan 28, 2011 at 09:31:37AM +0000, Carl Shaw wrote:
> > This occurs because the default maximum stack size is usually 8MB (check
> > using ulimit -s or -a at a shell prompt).
> > 
> > You have a number of options to change this:
> > 
> [...]
> > 2.  Allocate your own stack memory, insert into to a thread attribute
> > structure using pthread_attr_setstack() and use that when creating the
> > thread with pthread_create()
> 
> This is the approach application developers should take, since some
> libcs offer ridiculously large stacks (which are reserved/committed on
> systems with overcommit protection!) while others offer tiny ones. A
> portable program that uses nontrivial stack space needs to ensure it
> will be given enough, and a program that doesn't want to waste memory
> should ensure that it's not given too much.
> 
> > 3.  Patch the C library to use a more appropriate default rather than
> > calling getrlimit(RLIMIT_STACK)!
> 
> This sounds like a patch that belongs in uclibc. 32k would be a
> reasonable default.

I was completely satisfied with the following patch:
http://nbd.name/190-nptl_use_arch_default_stack_limit.patch

Maybe it can be accepted in the main tree?

Link to the discussion on openwrt-devel:
https://lists.openwrt.org/pipermail/openwrt-devel/2011-January/009439.html

-- 
  Alexander

Attachment: signature.asc
Description: PGP signature

_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to