real time task disapears... memory problem ?
Hello,
I'm currently working on feedback scheduling. I have a set of tasks : an MPC controller, a feedback scheduler, and some disturbance tasks.
To do feedback scheduling, I need to measure the execution time quite accurately, and xenomai can not measure the execution time spend in the secondary mode. So I'm trying to stay in the primary mode. I had some calloc and free in one function that made me leave primary mode (for the MPC task).
I tried to replace this by a rt_heap, and doing rt_heap_alloc in place of calloc, and I also tried to have static allocation.
In both cases, my MPC task disappears when executing it! (nothing in /proc/xenomai/stat after the first try to execute it, but present during initialisation. and the other tasks are still here).
I'm working on it for a few days now, and I can't find out what is wrong. I have tested to increase the maximum locked-in-memory size (in /etc/security/limits.conf). If I debug it with ddd, all is ok, array are well allocated...
The strangest thing is that if I put a printf (this make a switch to secondary mode) saying that heap allocation was successful, everything works fine. So there is a function call that kills my task if I am in primary mode, and executes well if I am in secondary mode?
Do you have any idea on where may be the mistake? Do you need some more information?
My config: Linux 2.6.17-x320 preempt
Thanks in advance,
Arnaud DESVAGES
Quoted 4 lines · DESVAGES Arnaud
Hello,
Quoted 8 lines
I'm currently working on feedback scheduling. I have a set of tasks : an MPC controller, a feedback scheduler, and some disturbance tasks.
To do feedback scheduling, I need to measure the execution time quite accurately, and xenomai can not measure the execution time spend in the secondary mode.
What kind of statistics would you precisely need? And where would you need it, means where is your scheduler located, what API does it use?
Quoted 34 lines
So I'm trying to stay in the primary mode. I had some calloc
and free in one function that made me leave primary mode (for the MPC task).I tried to replace this by a
rt_heap, and doingrt_heap_allocin place of calloc, and I also tried to have static allocation.In both cases, my MPC task disappears when executing it! (nothing in
/proc/xenomai/statafter the first try to execute it, but present during initialisation. and the other tasks are still here).I'm working on it for a few days now, and I can't find out what is wrong. I have tested to increase the maximum locked-in-memory size (in
/etc/security/limits.conf). If I debug it with ddd, all is ok, array are well allocated...The strangest thing is that if I put a printf (this make a switch to secondary mode) saying that heap allocation was successful, everything works fine. So there is a function call that kills my task if I am in primary mode, and executes well if I am in secondary mode?
Quoted 3 lines
Do you have any idea on where may be the mistake? Do you need some more information?
Primarily code. We need your code that demonstrates the weird behaviour. If you patched Xenomai in any way, that patch would be required as well of course.
BTW, did you already try to attach gdb to your disappearing process? Maybe it can catch what makes it terminate.
Quoted 6 lines
My config: Linux 2.6.17-x320 preempt
.config, Xenomai version, and I-pipe version can be helpful too.
Jan