RTAI 3.9 lock on rt_sem_wait

On Thu, Apr 18, 2013 at 4:01 PM, <dgerb [..] ...> wrote:

> Hi Peter,
> thanks for your reply. The only option I can see in the cmake file of RTT
> regarding boost is ORO_OS_USE_BOOST_THREAD that is set now to off in my
> case. I installed the last version of BOOST (1.53) and when I run the test
> the system hangs on:
> core-test and, precisely, at
> /home/laboratorio/rock/tools/rtt/rtt/os/lxrt/fosi.c line 114
> (rt_sem_wait(m->sem)).
> Any ideas?
>

Well, it's waiting on a semaphore, which isn't that strange. The question
is: why isn't it raised ?

Could you set these cmake options:

cd build; cmake . -DOROBLD_OS_AGNOSTIC=OFF -DOROSEM_OS_LXRT_CHECK=ON

?

Alternatively, apply the patch in attachment... it's a long shot.

Peter

AttachmentSize
0001-rtai-change-SEM-typedefs-again-in-agnostic-mode.patch1.18 KB

RTAI 3.9 lock on

I tried to compile with the option cmake . -DOROBLD_OS_AGNOSTIC=OFF -DOROSEM_OS_LXRT_CHECK=ON but it didn't change anythings.

I changed by hands the file lxrt/fosi.h according to the patch but there are many error of type :

[ 12%] Building C object rtt/CMakeFiles/orocos-rtt-lxrt_dynamic.dir/os/lxrt/fosi.c.o /home/laboratorio/rock/tools/rtt/rtt/os/lxrt/fosi.c: In function ‘rtos_sem_init’: /home/laboratorio/rock/tools/rtt/rtt/os/lxrt/fosi.c:94: error: ‘rt_sem_t’ has no member named ‘sem’ /home/laboratorio/rock/tools/rtt/rtt/os/lxrt/fosi.c:95: error: ‘rt_sem_t’ has no member named ‘sem’ /home/laboratorio/rock/tools/rtt/rtt/os/lxrt/fosi.c: In function ‘rtos_sem_destroy’: /home/laboratorio/rock/tools/rtt/rtt/os/lxrt/fosi.c:101: error: ‘rt_sem_t’ has no member named ‘sem’

If I change the functions in this way

    int rtos_sem_init(rt_sem_t* m, int value )
    {
        CHK_LXRT_CALL();
        
// m->sem = rt_sem_init( rt_get_name(0) , value); // return m->sem == 0 ? -1 : 0;
    m= rt_sem_init( rt_get_name(0) , value);
        return m == 0 ? -1 : 0;
    }
it compiles but the system hangs during the core-test. Just one time I read on the screen before the system hangs : CANNOT INIT LXRT Tread gloabalEngine....

thanks in advance Diego G

RTAI 3.9 lock on

On Thu, May 2, 2013 at 11:51 AM, <dgerb [..] ...> wrote:

> I tried to compile with the option cmake . -DOROBLD_OS_AGNOSTIC=OFF
> -DOROSEM_OS_LXRT_CHECK=ON but it didn't change anythings.
>
> I changed by hands the file lxrt/fosi.h according to the patch but there
> are
> many error of type :
>
> [ 12%] Building C object
> rtt/CMakeFiles/orocos-rtt-lxrt_dynamic.dir/os/lxrt/fosi.c.o
> /home/laboratorio/rock/tools/rtt/rtt/os/lxrt/fosi.c: In function
> ‘rtos_sem_init’:
> /home/laboratorio/rock/tools/rtt/rtt/os/lxrt/fosi.c:94: error: ‘rt_sem_t’
> has no member named ‘sem’
> /home/laboratorio/rock/tools/rtt/rtt/os/lxrt/fosi.c:95: error: ‘rt_sem_t’
> has no member named ‘sem’
> /home/laboratorio/rock/tools/rtt/rtt/os/lxrt/fosi.c: In function
> ‘rtos_sem_destroy’:
> /home/laboratorio/rock/tools/rtt/rtt/os/lxrt/fosi.c:101: error:
> ‘rt_sem_t’ has no member named ‘sem’
>
> If I change the functions in this way
> int rtos_sem_init(rt_sem_t* m, int value )
> {
> CHK_LXRT_CALL();
>
> // m->sem = rt_sem_init( rt_get_name(0) , value);
> // return m->sem == 0 ? -1 : 0;
> m= rt_sem_init( rt_get_name(0) , value);
> return m == 0 ? -1 : 0;
> }
>

You can keep this fix for now...

>
> it compiles but the system hangs during the core-test.
> Just one time I read on the screen before the system hangs :
> CANNOT INIT LXRT Tread gloabalEngine....
>

The I probably know what went wrong... could you check that the "Number of
LXRT slots" in the RTAI kernel configuration is at least 1000 ?

See the installation manual:
http://www.orocos.org/stable/documentation/rtt/v2.x/doc-xml/orocos-insta...

Peter

still problem with semaphore

Dear Peter, sorry for bothering you again, but I am still fighting against orocos (lxrt). And, up to now, it wins. This is my last shot beofre giving up. I have installed it on several machines, but I keep having the same problem. By doing a more careful debug, I can see that (task-test) for example stops on rtos_sem_wait(&(task->sem)) of void *thread_function(void* t) in rtt/os/Thread.cpp (line 116 of orocos-toolchain-2.6). I am trying to understand the code to figure out who should raise the semaphore. But it is very complex. Please, can you help me to figure out wath's wrong.

Thanks in advance. Best,

Diego

still problem with semaphore

Hi Diego,

The only way I can contribute to this, is if I can get hold of Ubuntu or
Debian packages for the kernel you're using and the RTAI libraries, such
that I can just compile and run Orocos in an RTAI virtual machine, and then
confirm your issue. Just looking at the RTAI 3.9 API won't reveal a thing...

For clarity, the bug is not in Orocos/Thread.cpp itself but in how we
translate rtos_* functions to the RTAI API, and possibly,how RTAI was
configured. The most safe way is to turn OS_AGNOSTIC off, such that we use
the RTAI structs directly, and not our own copies of it...

Peter

On Wed, May 8, 2013 at 6:41 PM, <dgerb [..] ...> wrote:

> Dear Peter,
> sorry for bothering you again, but I am still fighting against orocos
> (lxrt).
> And, up to now, it wins. This is my last shot beofre giving up.
> I have installed it on several machines, but I keep having the same
> problem.
> By doing a more careful debug, I can see that (task-test) for example stops
> on rtos_sem_wait(&(task->sem)) of void *thread_function(void* t)
> in rtt/os/Thread.cpp (line 116 of orocos-toolchain-2.6). I am trying to
> understand the code to figure out who should raise the semaphore. But it is
> very complex. Please, can you help me to figure out wath's wrong.
>
> Thanks in advance. Best,
>
>
> Diego
> --
> Orocos-Dev mailing list
> Orocos-Dev [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev
>

rtai options

As you suggest I focus my attention on the options of RTAI. According to "The OROCOS Real-Time Toolkit Installation Guide" during 'make menuconfig', I have enabled the options • General -> 'Enable extended configuration mode' • Core System -> Native RTAI schedulers > Scheduler options -> 'Number of LXRT slots' ('1000') • Machine -> 'Enable FPU support' but I haven't found the following options:

• Core System -> Native RTAI schedulers > IPC support -> Semaphores, Fifos, Bits (or Events) and Mailboxes

 
• Core System -> Native RTAI schedulers > 'LXRT scheduler (kernel and user-space tasks)'

do you think that is the problem?

rtai options

On Thu, May 23, 2013 at 6:42 PM, <dgerb [..] ...> wrote:
> As you suggest I focus my attention on the options of RTAI.
> According to "The OROCOS Real-Time Toolkit Installation Guide" during 'make
> menuconfig', I have enabled the options
> • General -> 'Enable extended configuration mode'
> • Core System -> Native RTAI schedulers > Scheduler options -> 'Number of
> LXRT slots' ('1000')
> • Machine -> 'Enable FPU support'
> but I haven't found the following options:
>
> • Core System -> Native RTAI schedulers > IPC support -> Semaphores, Fifos,
> Bits (or Events) and Mailboxes
>
> • Core System -> Native RTAI schedulers > 'LXRT scheduler (kernel and
> user-space tasks)'
>
> do you think that is the problem?

No, these are probably deprecated/removed options ? You do have
semaphores enabled somehow do you ?

Peter

RTAI 3.9 lock on

yes according to manual is 1000 Diego G