[Rtai] rt_task_init in user-space hangs the process (but not the system)

Shahbaz Yousefi shabbyx at gmail.com
Tue Sep 13 16:45:26 CEST 2011


I've been working with rtai for 7~8 months now and worked with rtai-magma
(got it in february 2011), rtai-magma (from may 2011, on a 32bit machine),
rtai 3.8 (I think) and recently rtai-magma (from may 2011, but on a 64bit

I am using RTAI LXRT in both kernel and user spaces, and with the first
three systems everything worked fine. I had been using

rt_task_delete( '\0' );

to make the current thread real-time temporarily to do some rt stuff and
then change it back to a normal linux thread.

On this last machine however (the 64 bit one), the first few times (first 2
times) that I run a program creating a user-space rtai task (using the code
above), it works successfully. BUT, after that few times, running a program
that calls rt_thread_init results in the program just stuck in that
function. One out of 20 times, after 30~60 seconds of issuing CTRL+C or
sending KILL signal, the program stops. Most of the times, though, this
doesn't happen the program is stuck forever. In such a case, every other
program calling rt_thread_init will also get stuck. The odd thing is that,
it's not like the function returns with a fail value. It just gets stuck
inside it.

This however doesn't affect the system itself (linux doesn't hang for
example and functions normally). (Edit: Rarely it does however. When I was
writing this message, after 1 minute past rmmod, linux hanged)

In this state, rmmod rtai_lxrt results in rmmod also getting stuck. In the
log files when rmmoding, it indicates that SCHED releases registered named
TASK ..., that it releases all the tasks that tr_thread_inited normally. The
tasks that got stuck in rt_thread_init are not released.

Besides this last log when rmmoding, there is no other log whatsoever.

When testing this, these modules were insmoded rtai_math, rtai_shm,
rtai_msg, rtai_mbx, rtai_sem, rtai_fifos, rtai_lxrt, rtai_hal. No other rt
programs, nor rt kernel modules were running/insmoded.

I saw that rt_thread_init is not documented in this version of rtai, so I
changed it to rt_task_init (with 0, 0 as stack and message sizes).
rt_task_delete, although I had read in older documentations that if given
'\0', would delete task assigned to current thread, I tested by giving it
the RT_TASK *returned by rt_task_init. No change in behaviour was observed.

I have attached the output of lshw if you were interested in my computers
hardware description. Additional to that information, I'm using Ubuntu

Please let me know if there is something wrong I am doing.
Thank you,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.rtai.org/pipermail/rtai/attachments/20110913/a4df8b11/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lshw_output_hw_desc
Type: application/octet-stream
Size: 16776 bytes
Desc: not available
URL: <http://mail.rtai.org/pipermail/rtai/attachments/20110913/a4df8b11/attachment.obj>

More information about the Rtai mailing list