Follow-up Comment #6, bug #18396 (project make): I've been recently caught out by setrlimit. I believe what happened is that pthread_create (in a child process) stack size default is on linux calculated from the stack limit.
>From the pthread_create man page: On Linux/x86-32, the default stack size for a new thread is 2 megabytes. Under the NPTL threading implementation, if the RLIMIT_STACK soft resource limit at the time the program started has any value other than "unlimited", then it determines the default stack size of new threads. If we start a program that calls pthread_create from the shell that has a soft limit of 8192k and no hard limit, then the new thread will get a 8192k stack. If the same program is started from make, then it will get a stack of 2048k because make removes the soft limit. I understand that calling pthread_create without setting the stack size is not recommended and that the defaulting mechanism is suspect. Still, it's surprising to find that make mucks with the limits. A way out could be to actually restore the limits before the child is exec'ed although that may not be legal or run into problems if the stack is in fact deeper than the original limit. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?18396> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make