On Fri, 2006-12-08 at 19:02 +0100, Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
> > Gilles Chanteperdrix wrote:
> >>Index: ksrc/nucleus/shadow.c
> >>===================================================================
> >>--- ksrc/nucleus/shadow.c   (révision 1930)
> >>+++ ksrc/nucleus/shadow.c   (copie de travail)
> >>@@ -888,6 +888,9 @@
> >> 
> >>    p = xnthread_archtcb(thread)->user_task;        /* May be != current */
> >> 
> >>+   if (!xnshadow_thrptd(p))
> >>+           return;
> >>+
> >>    magic = xnthread_get_magic(thread);
> >> 
> >>    for (muxid = 0; muxid < XENOMAI_MUX_NR; muxid++) {
> >>@@ -1639,8 +1642,6 @@
> >>            xnshadow_relax(0);
> >> 
> >>    xnlock_get_irqsave(&nklock, s);
> >>-   /* Prevent wakeup call from xnshadow_unmap(). */
> >>-   xnshadow_thrptd(p) = NULL;
> >>    xnthread_archtcb(thread)->user_task = NULL;
> >>    /* xnpod_delete_thread() -> hook -> xnshadow_unmap(). */
> >>    xnpod_delete_thread(thread);
> > 
> > 
> > Can't comment on the correctness of the second hunk, but it
> > unfortunately doesn't change the situation that test case does not
> > longer terminate with the first hunk applied. May look like a trivial
> > issue - but it isn't. :->
> > 
> 
> Indeed. And xnshadow_thrptd(current) == NULL is used by xnpod_schedule,
> so the patch is probably completely incorrect.
> 

We should rather check the TCB backlink to the Linux task. Could someone
who can reproduce this issue, test the following patch? TIA,

--- ksrc/nucleus/shadow.c       (revision 1931)
+++ ksrc/nucleus/shadow.c       (working copy)
@@ -888,6 +888,10 @@
 
        p = xnthread_archtcb(thread)->user_task;        /* May be != current */
 
+       xnltt_log_event(xeno_ev_shadowunmap, thread->name, p ? p->pid : -1);
+       if (!p)
+               goto renice_and_exit;
+
        magic = xnthread_get_magic(thread);
 
        for (muxid = 0; muxid < XENOMAI_MUX_NR; muxid++) {
@@ -907,10 +911,6 @@
                }
        }
 
-       xnltt_log_event(xeno_ev_shadowunmap, thread->name, p ? p->pid : -1);
-       if (!p)
-               goto renice_and_exit;
-
        xnshadow_thrptd(p) = NULL;
 
        if (p->state != TASK_RUNNING) {

-- 
Philippe.



_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to