From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jeffrey Melville <jmelville@mitre.org>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] SIGDEBUG_RESCNT_IMBALANCE with recursive mutex
Date: Wed, 1 Jun 2016 17:45:43 +0200 [thread overview]
Message-ID: <20160601154543.GD14103@hermes.click-hack.org> (raw)
In-Reply-To: <574EFA37.5030607@mitre.org>
On Wed, Jun 01, 2016 at 11:07:35AM -0400, Jeffrey Melville wrote:
> Hi,
>
> Setup: Xenomai 2.6.4 (actually 2.6 git rev 4f349cf0553, with a99426
> cherry-picked) with kernel 3.14.17 on a Zynq and the POSIX skin using
> the ipipe patches included with the specified git rev)
>
> We've noticed that SIGDEBUG_RESCNT_IMBALANCE is generated when a
> (Xenomai) mutex is taken recursively by an NRT thread. The snippet at
> the bottom of this message will reproduce the issue. I omitted most of
> the error-checking for brevity.
>
> A couple previous threads have discussed slightly similar problems, but
> I never saw final resolutions:
> http://www.xenomai.org/pipermail/xenomai/2012-January/025278.html
This issue is unrelated: setting a thread priority while holding a
mutex is clearly something we consider you should not be doing.
> http://www.xenomai.org/pipermail/xenomai/2014-October/031919.html
In this case, the mail asked the user to provide a test case, and
the user never provided one, it seems.
>
> As far as "why are we doing this?", the problem area occurs in a test
> suite where some tests have to run as NRT threads because they don't
> have to run real-time and will get killed by the watchdog if they run as
> RT threads. Removing the Xenomai wrappers would also be complicated for
> reasons that are outside of the scope of this email.
Now we have a testcase it seems. However, a Xenomai mutex used by an
NRT thread only makes sense if the mutex is shared with an RT thread
(otherwise you could use plain Linux mutex). In that context, it
makes little sense to not enable priority inheritance on the mutex.
So, the question is: do you have the same problem if you enable
priority inheritance?
Also, could you check the function return values, to make sure that
you did not miss any error?
Regards.
--
Gilles.
https://click-hack.org
next prev parent reply other threads:[~2016-06-01 15:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-01 15:07 [Xenomai] SIGDEBUG_RESCNT_IMBALANCE with recursive mutex Jeffrey Melville
2016-06-01 15:45 ` Gilles Chanteperdrix [this message]
2016-06-01 16:48 ` Jeffrey Melville
2016-06-01 16:45 ` Gilles Chanteperdrix
2016-06-01 16:58 ` Jeffrey Melville
2016-06-16 13:26 ` Gilles Chanteperdrix
2016-06-17 19:30 ` Jeffrey Melville
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=20160601154543.GD14103@hermes.click-hack.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=jmelville@mitre.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.