All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Fw:some API about RT_TASK occur Segmentation fault
@ 2017-02-06  1:30 dreamtale90
  2017-02-06 13:50 ` Philippe Gerum
  0 siblings, 1 reply; 6+ messages in thread
From: dreamtale90 @ 2017-02-06  1:30 UTC (permalink / raw)
  To: xenomai, rpm

System configuration:
debian-8.6, 3.18.46-rt50
Xenomai/mercury v3.0.3
Build args: --with-core=mercury --enable-smp --enable-pshared


Now I am need help. Thanks.





-------- Forwarding messages --------
From: "dreamtale90@163.com" <dreamtale90@163.com>
Date: 2017-02-04 12:04:15
To: xenomai@xenomai.org
Subject: some API about RT_TASK occur Segmentation fault

Hi
    During using API about RT_TASK I found some doubt.
1) rt_task_inquire(RT_TASK * task, RT_TASK_INFO * info ), if info is NULL will occur Segmentation fault, but in API reference this is valid.
http://www.xenomai.org/documentation/xenomai-3/html/xeno3prm/group__alchemy__task.html#ga53bad6acf5496f8008e594954507dce8


2) After main task called rt_task_shadow(), program will create other tasks depend on request, but when create second task will  occur Segmentation fault.
Now main task don't call  rt_task_shadow(), program will OK. I don't know why.


3) I write a demo which create the same task three times as follows:
#include <stdio.h>
#include <unistd.h>
#include <alchemy/task.h>
RT_TASK task1;
void func(void *arg)
{
 printf("enter func ...\n");
}
int main()
{
 rt_task_spawn(&task1, "task1", 0, 80, 0, func, NULL);
 sleep(1);
 rt_task_spawn(&task1, "task1", 0, 80, 0, func, NULL);
 sleep(1);
 rt_task_spawn(&task1, "task1", 0, 80, 0, func, NULL);
 //rt_task_delete(&task1);
 return 0;
}


When the third time create , program will  occur Segmentation fault.




 

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

end of thread, other threads:[~2017-02-08  2:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-06  1:30 [Xenomai] Fw:some API about RT_TASK occur Segmentation fault dreamtale90
2017-02-06 13:50 ` Philippe Gerum
2017-02-07  6:18   ` dreamtale90
2017-02-07 14:19     ` [Xenomai] some " dreamtale90
2017-02-07 15:17       ` Philippe Gerum
2017-02-08  2:03         ` dreamtale90

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.