All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: xenoka09@domain.hid
Cc: xenomai@xenomai.org, Pierre.QUELIN@solystic.com
Subject: Re: [Xenomai-help] debug posix skin - pthread_cond_wait return EPERM
Date: Fri, 21 Jan 2011 15:00:31 +0100	[thread overview]
Message-ID: <1295618431.1828.52.camel@domain.hid> (raw)
In-Reply-To: <alpine.DEB.1.10.1101211225490.3495@domain.hid>

On Fri, 2011-01-21 at 13:03 +0100, Kolja Waschk wrote:
> Hi,
> 
> > The following patch seems to fix the issue, but I am not yet sure
> > diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
> 
> Yes it does fix it for me too. The output of my "try" program when run with
> gdbserver still differs from the output when run standalone, but at least there
> are no EPERM results anymore. The first two tasks cycle pthread_cond_wait more
> than once.
> 
> 0 3x 0x0010
> 1 2x 0x0010
> 2 1x 0x0010
> 
> If I remove the pthread_yield() again there'll be a lockup again, for which I
> cannot see an actual reason. Now, there's no need to explain why this code
> can enter an endless loop and that it's no good style to do nothing with error
> return codes. But.. shouldn't I be able to break in with gdb via gdbserver
> anyway and see where the application is stuck? To interrupt - by chance - the
> loop in the right moment to be able a look at my result variable "r"...  Even
> if the loop is in a RT task with highest priority?
> 
> According to
> http://www.xenomai.org/index.php/FAQs#How_can_GDB_be_used.3F
> there are no limitations. Maybe it is specific to uClinux/linuxthreads/...?

This doc only says that GDB can be used the usual way, but it does not
guarantee that GDB may respond properly in case your real-time system
prevents the linux kernel from running.

> 
> I was originally expecting that I could hit Ctrl-C on the gdb host at any
> moment, type "info threads" and get an idea of what is happening in my stuck
> app (taking into account that afterwards some threads might have left their
> domain just because I interacted).

There is no way this could work if your target is stuck in an endless
primary mode loop. In that case, the gdb stub which is part of the
regular kernel just can't receive the remote "break" command packet sent
from your host, simply because the remote linux  kernel is not given any
CPU time. You have to enable the Xenomai watchdog for exiting this
situation.

I suspect that if pthread_yield() allows you to regain control via ^C,
then it is likely not the Xenomai wrapped service which gets called, but
rather the plain glibc one, which moves your thread to secondary mode,
hence resumes the linux kernel for a while, enough to process the
interrupt packet.

> 
> Kolja
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help

-- 
Philippe.




  reply	other threads:[~2011-01-21 14:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20  8:03 [Xenomai-help] debug posix skin - pthread_cond_wait return EPERM Pierre.QUELIN
2011-01-20  8:28 ` Kolja Waschk
2011-01-20 14:55   ` Gilles Chanteperdrix
2011-01-20 16:44     ` Kolja Waschk
2011-01-20 16:56       ` Gilles Chanteperdrix
2011-01-20 17:16         ` Kolja Waschk
2011-01-20 17:30           ` Gilles Chanteperdrix
2011-01-20 18:57             ` Waschk,Kolja
2011-01-20 19:09               ` Gilles Chanteperdrix
2011-01-20 19:22                 ` Waschk,Kolja
2011-01-21 13:09                 ` Kolja Waschk
2011-01-21 14:12                   ` Philippe Gerum
2011-01-21 11:25             ` Kolja Waschk
2011-01-24 12:31               ` Gilles Chanteperdrix
2011-01-25  8:53                 ` Kolja Waschk
2011-01-25  8:51                   ` Gilles Chanteperdrix
2011-01-25  8:55                     ` Gilles Chanteperdrix
2011-01-25  9:06                     ` Kolja Waschk
2011-01-20 18:36           ` Gilles Chanteperdrix
2011-01-20 19:13             ` Gilles Chanteperdrix
2011-01-21 12:03               ` Kolja Waschk
2011-01-21 14:00                 ` Philippe Gerum [this message]
2011-01-21 14:16                   ` Kolja Waschk
2011-01-22 15:07                 ` Gilles Chanteperdrix
2011-01-22 15:20                 ` Gilles Chanteperdrix
2011-01-20 17:33         ` [Xenomai-help] gpio Cagnulein
2011-01-20 17:55           ` Gilles Chanteperdrix
2011-01-21  8:43 [Xenomai-help] debug posix skin - pthread_cond_wait return EPERM Pierre.QUELIN
2011-01-22 14:39 ` Gilles Chanteperdrix
2011-01-24 14:57 Pierre.QUELIN

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=1295618431.1828.52.camel@domain.hid \
    --to=rpm@xenomai.org \
    --cc=Pierre.QUELIN@solystic.com \
    --cc=xenoka09@domain.hid \
    --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.