From: Frederik Bayart <frederik_bayart@yahoo.co.uk>
To: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: [Xenomai] rt_heap_alloc size 0 - syscall 7 denied
Date: Wed, 14 Oct 2015 10:22:22 +0000 (UTC) [thread overview]
Message-ID: <2122790682.242206.1444818142434.JavaMail.yahoo@mail.yahoo.com> (raw)
In-Reply-To: 2122790682.242206.1444818142434.JavaMail.yahoo@mail.yahoo.com
Hallo,
I'm using xenomai 3.0 on kernel 3.18.20 (64 bit).
When using single block heap, I'm getting memory allocation problem when calling rt_heap_alloc with size 0. I don't get the error when calling the function with size used in rt_heap_create.
On the mailing list, I found there has been an issue with this in May : http://www.xenomai.org/pipermail/xenomai/2015-May/034165.html
Is this still an issue ?
In attachment a test program htest.c + makefile to generate the problem :
$ sudo ./htest 1 ==> use 0
htest.c:69: heapsize = 70000, usablemem = 70144, usedmem = 0
htest.c:79 ERROR: rt_heap_alloc(-12): Cannot allocate memory
$ sudo ./htest 1 ==> use same size as in create
htest.c:69: heapsize = 70000, usablemem = 70144, usedmem = 0
htest.c:92: heapsize = 70000, usablemem = 70144, usedmem = 70144
However, I both cases, I get a trace in dmesg :
[Xenomai] syscall <7> denied to sysregd
I have no idea why I'm getting this trace. Does anybody has a suggestion ? I found that this error is printed probably in ./kernel/cobalt/posix/syscall.c
If I'm right, syscall 7 would be sc_cobalt_thread_setschedparam_ex (cfr. ./doc/prebuilt/html/xeno3prm/include_2cobalt_2uapi_2syscall_8h_source.html)
I still have other problems which I'm looking at, so maybe they have the same cause.
This is the content of the registry when allocation succeeds :
/var/run/xenomai# find .
.
./root
./root/anon@21808
./root/anon@21808/21808
./root/anon@21808/21808/alchemy
./root/anon@21808/21808/alchemy/heaps
./root/anon@21808/21808/alchemy/heaps/TESTHEAP
./root/anon@21808/system
./root/anon@21808/system/threads
./root/anon@21808/system/heaps
./root/anon@21808/system/version
# xeno-config --info
Xenomai version: Xenomai/cobalt v3.0 --
Linux dev1 3.18.20-x86-64-xeno-3.03p.0.0 #1 SMP PREEMPT Tue Oct 13 16:58:44 CEST 2015 x86_64 GNU/Linux
Kernel parameters: BOOT_IMAGE=/vmlinuz-3.18.20-x86-64-xeno-3.03p.0.0 root=UUID=20f2dd2f-f02f-4b82-8538-8fe52e55a8ff ro quiet
I-pipe release #3 detected
Cobalt core 3.0 detected
Compiler: gcc version 4.9.2 (Debian 4.9.2-10)
Build args: --prefix=/usr --includedir=/usr/include/xenomai --mandir=/usr/share/man --with-testdir=/usr/lib/xenomai/testsuite --with-core=cobalt --enable-smp --enable-pshared --enable-registry --build x86_64-linux-gnu build_alias=x86_64-linux-gnu
I have also attached the kernel config.
Kind regards,
Frederik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config-3.18.20-x86-64-xeno-3.03p.0.0
Type: application/octet-stream
Size: 128070 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20151014/7024f00c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: htest.c
Type: text/x-csrc
Size: 2268 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20151014/7024f00c/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: makefile
Type: application/octet-stream
Size: 622 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20151014/7024f00c/attachment-0001.obj>
next parent reply other threads:[~2015-10-14 10:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 10:22 Frederik Bayart [this message]
2015-10-14 10:43 ` [Xenomai] rt_heap_alloc size 0 - syscall 7 denied Philippe Gerum
2015-10-14 12:21 ` Frederik Bayart
2015-10-14 12:41 ` Philippe Gerum
2015-10-14 16:55 ` Frederik Bayart
2015-10-15 7:56 ` Philippe Gerum
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=2122790682.242206.1444818142434.JavaMail.yahoo@mail.yahoo.com \
--to=frederik_bayart@yahoo.co.uk \
--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.