* [Xenomai] rt_heap_alloc fails in shared session mode.
@ 2015-05-29 13:21 Stéphane ANCELOT
0 siblings, 0 replies; only message in thread
From: Stéphane ANCELOT @ 2015-05-29 13:21 UTC (permalink / raw)
To: xenomai@xenomai.org
Hi,
The next code snippet fails in session mode.
I can create and allocate heaps from a program.
In another one, I can bind , but rt_heap_inquire fails with Invalid
argument.
Or I can use rt_alloc_heap with it. But when accessing memory, a bus
error is trapped.
//err = rt_heap_bind(heap_desc[module],module,TM_INFINITE);
err = rt_heap_bind(heap_desc[module],module,TM_INFINITE);
if (err != 0)
{
printf("can not bind %s [%s]\n",module,strerror(-err));
return (void *) -1;
}
// err = rt_heap_inquire(heap_desc[module],&info);
// if (err != 0) {
// printf("can not inquire info about %s
[%s]\n",module,strerror(-err));
// return (void *) -1;
// }
// printf("size %d\n,",info.heapsize);
err = rt_heap_alloc((RT_HEAP *)heap_desc[module],4288,TM_INFINITE,
&shmem);
if (err == 0)
{
return shmem;
}
else {
printf("can not alloc %s [%s]\n",module,strerror(-err));
return (void *) -1;
}
Regards,
S.Ancelot
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-05-29 13:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-29 13:21 [Xenomai] rt_heap_alloc fails in shared session mode Stéphane ANCELOT
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.