All of lore.kernel.org
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: Jan Kiszka <jan.kiszka@siemens.com>, Philippe Gerum <rpm@xenomai.org>
Cc: Xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] Heads up: some race condition fixes for Xenomai 3
Date: Tue, 7 Mar 2017 19:34:44 +0100	[thread overview]
Message-ID: <20170307193444.79df74cd@md1em3qc> (raw)
In-Reply-To: <558D5FAD.3060003@siemens.com>

Am Fri, 26 Jun 2015 16:20:29 +0200
schrieb Jan Kiszka <jan.kiszka@siemens.com>:

> Hi,
> 
> just pushed 3 patches to git.xenomai.org/xenomai-jki.git for-forge
> that are supposed to fix race conditions while manipulating
> xnthread::state and info (both need to be nklock-protected). Please
> review if finding and fixes make sense.
> 
>       cobalt/kernel: Fix locking for xnthread info manipulations
>       cobalt/kernel: Fix locking for setting XNFPU
>       cobalt/kernel: Rework thread debugging helpers
> 
> Maybe some of the issues also exist in Xenomai 2, didn't check yet.

After looking deeper into the the mysterious -EINTR i asked about a few
days ago we now got a trace that suggests something is going wrong. Jan
remembered the race in thread flag manipulation he found in Xeno3.

I did not do a thorough code analysis yet but instead just put two
asserts into xnthread_set_info and xnthread_clear_info.
1. !xnlock_is_owner(&nklock)
2. xnpod_current_thread() != thread_to_update

Both cases do happen. The flags are manipulated without holding the
lock and the flags are manipulated from another context. I guess that
suggests that the race found in xenomai3 is also in xenomai2.

Henning



  parent reply	other threads:[~2017-03-07 18:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26 14:20 [Xenomai] Heads up: some race condition fixes for Xenomai 3 Jan Kiszka
2015-06-26 15:07 ` Gilles Chanteperdrix
2015-06-26 15:24   ` Jan Kiszka
2017-03-07 18:34 ` Henning Schild [this message]
2017-03-08  8:54   ` Philippe Gerum
2017-03-08 11:25     ` Jan Kiszka
2017-03-08 11:29       ` Philippe Gerum
2017-03-08 11:32         ` Jan Kiszka
2017-03-08 11:42           ` Philippe Gerum
2017-03-08 11:48             ` Philippe Gerum
2017-03-09  9:05       ` Henning Schild

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=20170307193444.79df74cd@md1em3qc \
    --to=henning.schild@siemens.com \
    --cc=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.