From: Jan Kiszka <jan.kiszka@domain.hid>
To: rpm@xenomai.org
Cc: Thomas Wiedemann <Thomas.Wiedemann@domain.hid>, xenomai@xenomai.org
Subject: Re: [Xenomai-core] [BUG] module usage counter of xenomai native corrupted (version 2.2.0 and 2.2.5)
Date: Fri, 08 Dec 2006 20:05:16 +0100 [thread overview]
Message-ID: <4579B76C.8060804@domain.hid> (raw)
In-Reply-To: <1165602165.9091.45.camel@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2270 bytes --]
Philippe Gerum wrote:
> 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) {
>
Doesn't work, usage counter is now incremented. BTW, this patch slipped
into SVN with the iobitmap fix.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next prev parent reply other threads:[~2006-12-08 19:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-07 13:09 [Xenomai-core] [BUG] module usage counter of xenomai native corrupted (version 2.2.0 and 2.2.5) Thomas Wiedemann
2006-12-07 14:35 ` Jan Kiszka
2006-12-08 8:38 ` Gilles Chanteperdrix
2006-12-08 10:03 ` Gilles Chanteperdrix
2006-12-08 12:13 ` Jan Kiszka
2006-12-08 13:27 ` Gilles Chanteperdrix
2006-12-08 14:54 ` Jan Kiszka
2006-12-08 18:02 ` Gilles Chanteperdrix
2006-12-08 18:22 ` Philippe Gerum
2006-12-08 19:05 ` Jan Kiszka [this message]
2006-12-08 21:35 ` Philippe Gerum
2006-12-11 18:06 ` Philippe Gerum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4579B76C.8060804@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=Thomas.Wiedemann@domain.hid \
--cc=rpm@xenomai.org \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.