From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Dehann Fourie <dehann.fourie@domain.hid>
Cc: Xenomai help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Segmentation Fault
Date: Sat, 04 Oct 2008 22:10:15 +0200 [thread overview]
Message-ID: <48E7CDA7.1010102@domain.hid> (raw)
In-Reply-To: <2b490f270809301326jd381307md432bd4cdfe36d3b@domain.hid>
Dehann Fourie wrote:
> Hi,
>
> Sorry for the lack of information, I'm still bit of a new guy. I have found
> the following (I do use a mlockall(current | future)):
>
> When i declare larger arrays in the real-time task I get the segmentation
> fault. This is when I declare as follows
> double arr[10000]; //some KB sized value
>
> When I use malloc I don't get the problem. My question now is where does the
> first one declare the memory. I am assuming that the malloc declares strait
> into the RAM, becuase there I am safe to declare a couple of MB?
It depends on where you declare double arr[10000]. If this is outside of
any scope, then it ends up in an anonmous map. If this is declared in a
function, then it ends up on the current thread stack, so, in this case
the current thread stack has to be large enough to allow such an
allocation (in your case, sizeof(arr) == 80000, that is around 80Kbytes).
--
Gilles.
next prev parent reply other threads:[~2008-10-04 20:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-26 13:10 [Xenomai-help] Segmentation Fault Dehann Fourie
2008-09-26 15:55 ` Gilles Chanteperdrix
2008-09-30 20:26 ` Dehann Fourie
2008-10-04 20:10 ` Gilles Chanteperdrix [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-03-03 18:55 Wayne Call
2009-03-03 19:07 ` Gilles Chanteperdrix
2010-07-12 9:24 [Xenomai-help] Segmentation fault Oliver Clugnet
2010-07-12 9:31 ` Gilles Chanteperdrix
[not found] ` <4C3AE2EE.9050701@domain.hid>
2010-07-12 9:46 ` 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=48E7CDA7.1010102@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=dehann.fourie@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.