On 2011-01-28 1:28 PM, Alexander Gordeev wrote:
> Hi!
> 
> I have a device with only 16MB of memory and I want to run threaded
> applications on it. The size of allocated stack space in uClibc's
> implementation of pthread_create equals to the stack size limit as
> returned by ulimit -s (or the default for the current architecture if
> the limit is set to 'unlimited' which is 2MB for MIPS). The problem is
> that the limit on my 16MB box is somehow set to 8MB for all processes
> which is a half of available RAM so the allocation fails. If I enable
> aggressive overcommit (echo 1 > /proc/sys/vm/overcommit_memory) or
> lower the limit (ulimit -s 2048 or ulimit -s unlimited) then everything
> works like a charm.
> 
> Where is the 8MB stack size limit set?
> 
> BTW I use openwrt trunk, uClibc 0.9.32 with nptl, everything else is
> default.
Please try copying this patch to toolchain/uClibc/patches-0.9.32 -
http://nbd.name/190-nptl_use_arch_default_stack_limit.patch
and see if rebuilding uclibc with it fixes the problem.

The issue that I found is that if getrlimit returns a valid value for
the stack limit, it will be used as a default even if the architecture
specific default is lower.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to