All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel Merrill" <daniel.merrill@psware.com>
To: 'Philippe Gerum' <rpm@xenomai.org>, xenomai@xenomai.org
Subject: Re: [Xenomai] t_suspend and XNBREAK
Date: Wed, 9 Oct 2013 10:01:35 -0700 (MST)	[thread overview]
Message-ID: <73cb019f.0000172c.0000001c@dmerrill_win764.PERF.PERFORMANCESOFTWARE> (raw)
In-Reply-To: <525587A2.5000507@xenomai.org>

On 10/09/2013 06:37 PM, Daniel Merrill wrote:
> On 10/09/2013 06:29 PM, Daniel Merrill wrote:
>> All,
>>
>>
>>
>> I'm hoping maybe someone can shed a little more light on the issue we 
>> see occasionally. Occasionally our code using the psos+ skin will 
>> fail a
>> t_suspend(0) with error code -4, which I found to be EINTR and 
>> appears to be set if the XNBREAK flag is set. After digging around in 
>> the documentation I found some references that seem to indicate that 
>> this means the thread was forcibly unblocked for some reason. Is 
>> there some way to diagnose what caused this (I'm having trouble 
>> pinpointing anything)? It appears when debugging that the thread 
>> never really suspends at all but returns immediately from the call. 
>> Does anyone have some pointers on what might be a good place to start 
>> looking for
> the culprit? Thanks in advance.
>
> Are you tracing the application with GDB?
>
> We are using GDB to diagnose problems, can this cause the issue?

It should not, but one of the reasons for a thread to get forcibly
unblocked is to receive a regular linux signal when blocked in primary
mode. Since GDB does send quite a few signals to the application when
single-stepping/breakpointing the code, this information may be useful to
know. In short, GDB/ptracing might magnify a bug in this area.

If this issue also happens with no ptracing, then some other source kicked
the thread out of wait state, and we'd have to instrument the code to know
who does this.

I believe we do see it more often when we are using GDB, I do know of one
specific example that happens in gdb but does not happen if we run with no
debugger. In that particular case it doesn't matter if we are single
stepping or not, with breakpoints or without, the mere fact that gdb is
attached seems to activate the issue. We haven't been able to tell if it
is gdb itself that is directly causing the issue or if attaching gdb is
causing some other side effect (maybe timing related) that then causes the
problem to appear.


  reply	other threads:[~2013-10-09 17:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09 16:29 [Xenomai] t_suspend and XNBREAK Daniel Merrill
2013-10-09 16:33 ` Philippe Gerum
2013-10-09 16:37   ` Daniel Merrill
2013-10-09 16:43     ` Philippe Gerum
2013-10-09 17:01       ` Daniel Merrill [this message]
2013-10-16 18:30         ` Daniel Merrill
2013-10-21 18:21           ` Daniel Merrill
2013-10-22 13:46             ` Philippe Gerum
2013-10-22 14:49               ` Gilles Chanteperdrix
2013-10-22 16:53                 ` Philippe Gerum
2013-10-22 22:10                   ` Daniel Merrill
2013-10-23 17:31                     ` Philippe Gerum
2013-10-23 23:11                       ` Daniel Merrill
2013-10-24 10:03                         ` Philippe Gerum
2013-10-24 15:52                           ` Daniel Merrill
2013-10-24 18:24                           ` Daniel Merrill
2013-10-22 16:50               ` Daniel Merrill
2014-05-20 12:52           ` 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=73cb019f.0000172c.0000001c@dmerrill_win764.PERF.PERFORMANCESOFTWARE \
    --to=daniel.merrill@psware.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.