Fabien MAHOT wrote:
 > > On Thu, May 29, 2008 at 1:26 PM, Fabien MAHOT
 > > <[EMAIL PROTECTED]> wrote:
 > >> I succeed to reduce my test program.
 > >> Now, I ve got two xenomai threads.
 > >> threadDisplay (prio : 70) : locks a mutex (conflict_lock mutex) and
 > >> passes
 > >> between Xenomai and Linux domain. (call to sleep())
 > >> threadTimeOut (prio : 80) : Starts one timeout of 5ms and tries to lock
 > >> the mutex taken by threadDisplay. (Priority Inheritance)
 > >>
 > >> threadTimeOut waits the conflict_lock unlock of threadDisplay. With
 > >> priority inheritance, threadTimeOut gives its priority to threadDisplay.
 > >> But, threadTimeOut must also do the EndTimeOut() processing. When the
 > >> timeout end signal arrives, if threadDisplay is into Linux Domain, the
 > >> system crashes.
 > >
 > > Do you have the same crash if you use vanilla Linux timer services
 > > (__real_timer_create, __real_timer_settime, etc...).
 > >
 > > --
 > >  Gilles
 > 
 > Hello,
 > 
 > I try with vanilla linux timer. If threadTimeOut sets up one or two
 > timeouts, now, it's ok. But if it sets up more than two timeouts, the
 > system crashes.
 > I ve got the same error kernel traces as Posix timer use.
 > 
 > (By the way, In which file vanilla timer services are written ?
 > __real_timer_create ... are declared in time.h in xenomai files. I look
 > for in linux and glibc sources but I don t find them.)
 > 
 > I send you a test program in which severals timeouts can be created.

Ok. Got it now. The error you have is fixed in the v2.4.x branch. So,
here is a patch that you can apply to the v2.4.3 release.

-- 


                                            Gilles.
Index: ksrc/nucleus/shadow.c
===================================================================
--- ksrc/nucleus/shadow.c       (revision 3704)
+++ ksrc/nucleus/shadow.c       (working copy)
@@ -276,9 +276,11 @@ static void rpi_update(xnthread_t *threa
 
        xnlock_get_irqsave(&rpislot->lock, s);
 
-       sched_removepq(&rpislot->threadq, &thread->xlink);
-       rpi_none(thread);
-       rpi_push(thread, cpu);
+       if (rpi_p(thread)) {
+               sched_removepq(&rpislot->threadq, &thread->xlink);
+               rpi_none(thread);
+               rpi_push(thread, cpu);
+       }
 
        xnlock_put_irqrestore(&rpislot->lock, s);
 }
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to