All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] POSIX skin default stacksize
@ 2010-01-20 23:57 Steve Deiters
  2010-01-21  8:29 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Deiters @ 2010-01-20 23:57 UTC (permalink / raw)
  To: xenomai

I'm trying to determine the source of a bogus initial stack size after I
initialize a pthread_attr_t with pthread_attr_init.  I'm using the POSIX
skin (obviously), but I'm not quite sure if it is getting this parameter
from Xenomai or libc.

I'm running on a custom PowerPC board with a version 2.6.24.6 kernel.  I
get the same result using both Xenomai 2.4.10, and 2.5.0.  I noticed the
issue after having a small program with a few number of threads that was
crashing the system with an out of memory exception.

I have a very basic program ...

----------------------main.c--------------------------
#include <stdio.h>
#include <pthread.h>
#include <limits.h>

int main(int argc, char **argv)
{
   size_t s;
   pthread_attr_t a;

   pthread_attr_init(&a);
   pthread_attr_getstacksize(&a, &s);

   printf("PTHREAD_STACK_MIN is %d\n", PTHREAD_STACK_MIN);
   printf("Default stack size is %d\n", s);

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

For which the output is

>PTHREAD_STACK_MIN is 16384
>Default stack size is 8388608

As you can see, the stack size after I call pthread_attr_init is a
whopping 8 MB.

>From what I can tell, it is linking against the correct library.  I can
see the Xenomai options to the linker, with the -lpthread_rt and all
that.

Any idea why this would occur?

Thanks



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-21  8:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20 23:57 [Xenomai-help] POSIX skin default stacksize Steve Deiters
2010-01-21  8:29 ` Gilles Chanteperdrix

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.