All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] rt_heap_alloc size 0 - syscall 7 denied
@ 2015-10-14 10:22 Frederik Bayart
  2015-10-14 10:43 ` Philippe Gerum
  0 siblings, 1 reply; 6+ messages in thread
From: Frederik Bayart @ 2015-10-14 10:22 UTC (permalink / raw)
  To: xenomai

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>

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

end of thread, other threads:[~2015-10-15  7:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-14 10:22 [Xenomai] rt_heap_alloc size 0 - syscall 7 denied Frederik Bayart
2015-10-14 10:43 ` 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

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.