From: Jan Kiszka <jan.kiszka@siemens.com>
To: Philippe Gerum <rpm@xenomai.org>, Xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] Xenomai 3: smokey test sched_tp causes oops when run in gdb
Date: Mon, 16 Mar 2015 16:31:07 +0100 [thread overview]
Message-ID: <5506F73B.5020103@siemens.com> (raw)
In-Reply-To: <5506EC14.9070302@xenomai.org>
On 2015-03-16 15:43, Philippe Gerum wrote:
> On 03/11/2015 03:47 PM, Jan Kiszka wrote:
>> Hi Philippe,
>>
>> just happened to trigger the oops below by running
>>
>> gdb --args smokey --run=8
>>
>> That run already has troubles and generates different output than
>> running the test without gdb surveillance, probably due to unexpected
>> mode switches.
>
> Clearly, yes. GDB causes the test program to leave primary mode, which
> changes the scheduling order, and therefore the output which depends on it.
>
> But the real problem is that running the test again
>> afterwards, with or without gdb, causes the oops. Registers contain
>> suspicious "dead" patterns, thus we access invalid list elements. Do we
>> miss a cleanup when terminating smokey in the gdb session?
>>
>
> I could not reproduce this bug yet.
>
> There is no reason for ptracing the application to have any impact on
> the housekeeping chores when it exits. The backtrace shows that
> xnsched_tp_set_schedule() is walking through tp->threads, which seems to
> link to a stale tcb. xnsched_tp_forget() would then be called twice,
> leading to the fault.
>
> Normally, a thread that undergoes TP scheduling should be automatically
> removed from tp->threads upon exit after this sequence took place:
>
> handle_taskexit_event -> __xnthread_cleanup -> cleanup_tcb ->
> xnsched_forget -> xnsched_tp_forget
>
> For that bug to happen, either this assumption has to be wrong, or
> xnsched_set_policy() is being silly at some point.
>
> Is this 100% reproducible on your end, and does this require the initial
> gdb run to show up, or would that break even when running the sched_tp
> twice without gdb?
It is always reproducible, also with current next branch. And you need
to run gdb beforehand, yes.
I'll see if I can look into details.
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2015-03-16 15:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-11 14:47 [Xenomai] Xenomai 3: smokey test sched_tp causes oops when run in gdb Jan Kiszka
2015-03-11 15:12 ` Philippe Gerum
2015-03-16 14:43 ` Philippe Gerum
2015-03-16 15:31 ` Jan Kiszka [this message]
2015-03-16 16:00 ` Jan Kiszka
2015-03-16 16:02 ` Jan Kiszka
2015-03-16 16:09 ` Philippe Gerum
2015-03-16 16:42 ` Jan Kiszka
2015-03-16 17:16 ` Jan Kiszka
2015-03-16 19:24 ` Philippe Gerum
2015-03-16 19:35 ` Jan Kiszka
2015-03-16 19:41 ` Philippe Gerum
2015-03-16 19:44 ` Jan Kiszka
2015-03-16 20:00 ` 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=5506F73B.5020103@siemens.com \
--to=jan.kiszka@siemens.com \
--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.