From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Roderik_Wildenburg@domain.hid, xenomai@xenomai.org
Subject: Re: [Xenomai-help] memset of heap crashes Xenomai-Task
Date: Mon, 10 Jul 2006 19:40:16 +0200 [thread overview]
Message-ID: <44B29100.4070206@domain.hid> (raw)
In-Reply-To: <17586.28969.44700.753766@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 1392 bytes --]
Gilles Chanteperdrix wrote:
> Roderik_Wildenburg@domain.hid wrote:
> > Xenomai Version : 2.2-rc2
> > Skin : native
> > Kernel : 2.4.25
> > Arch.: PPC
> >
> > I try to allocate as much memory as possible with the functions :
> > rt_heap_create and
> > rt_heap_alloc.
> > (see also "Xenomai heap services" in this mailing list; see source
> > attached)
> >
> > When I try to use the allocated memory with memset, the Xenomai-task
> > crashes with a "Segmentation fault".
> >
> > Is memset allowed to be used with Xenomai heaps ?
>
> memset should work with Xenomai heaps, I suspect your problem is rather
> that the memory is not really allocated until you memset it, which fails
> when no memory is available. In this case, calling memset on memory
> allocated with malloc should segfault the same way when the system
> memory is exhausted. IIRC, this behaviour is documented in mlockall
> manual page.
I wonder if this "virtual allocation" also applies to vmalloc'ed memory
like in this case. I don't think so, or the kernel would oops as well.
>
> Be careful with sysconf(_SC_AVPHYS_PAGES), it may include the swap size,
> but when mlocking memory, your application can not use swap pages, so,
> you should substract the size of swap, if any.
> Also, what is the value of /proc/sys/vm/overcommit_memory on your system
> ?
>
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next prev parent reply other threads:[~2006-07-10 17:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-10 14:45 [Xenomai-help] memset of heap crashes Xenomai-Task Roderik_Wildenburg
2006-07-10 15:24 ` Gilles Chanteperdrix
2006-07-10 17:40 ` Jan Kiszka [this message]
2006-07-10 17:49 ` Gilles Chanteperdrix
2006-07-10 17:26 ` Jan Kiszka
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=44B29100.4070206@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=Roderik_Wildenburg@domain.hid \
--cc=gilles.chanteperdrix@xenomai.org \
--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.