All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Daniel Schnell <daniel.schnell@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] MPC5200 OOPS time
Date: Fri, 17 Nov 2006 17:55:25 +0100	[thread overview]
Message-ID: <455DE97D.6020701@domain.hid> (raw)
In-Reply-To: <DD39B5C3F4963040ADC9768BE7E430CB015D480C@is-hdq-exchange.marel.net>

Daniel Schnell wrote:
> Hi,
>  
>  
> attached you find a test program that will badly crash here on our
> ELDK4.0 based MPC5200 board.
>  
> It will create a bunch of tasks, which itself will allocate different
> amount of memory, clock_nanosleep() afterwards and return the allocated
> memory back to the system pool.
> If one gives a reasonable high number as command line argument (number
> of tasks to spawn), you will certainly starve the system memory pretty
> soon.
>  
> There are several (probably unrelated) issues you can trigger with this:
>  
> 1.) Without setting an ulimit -s, just using the standard linux stack
> space and calling it with

You should set the threads stack size with pthread_attr_setstacksize (as
other pthread_attr_set* functions, it should be used on a previously
initialized pthread_attr_t structure), ulimit -s only set the stack size
of the main thread, at least on some architectures.

This is probably unrelated to the errors you see, but:
- passing the pthread_mutex_t by value is not supposed to work; once a
pthread_mutex_t is initialized with pthread_mutex_init, you should pass
the address of the very same pthread_mutex_t to other functions of the API.
- pthread_t, on the other hand is an identifier, and may be passed by
value; if you look at functions taking pthread_t as argument, they all
take the argument by value, except pthread_create. So allocating some
space for these identifiers is useless.

Now, about the errors you see, it would be nice if you could separate
the two issues: could you try hitting ctrl-C when running your program
with stacks small enough so that there is enough room.

-- 
                                                 Gilles Chanteperdrix


  reply	other threads:[~2006-11-17 16:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-17 16:20 [Xenomai-help] MPC5200 OOPS time Daniel Schnell
2006-11-17 16:55 ` Gilles Chanteperdrix [this message]
2006-11-17 19:42   ` Daniel Schnell
2006-11-20  9:29     ` Gilles Chanteperdrix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=455DE97D.6020701@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=daniel.schnell@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.