From: Wolfgang Grandegger <wg@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Oops with synchronous message passing support
Date: Thu, 09 Jun 2011 15:34:18 +0200 [thread overview]
Message-ID: <4DF0CBDA.9080300@domain.hid> (raw)
In-Reply-To: <1307624711.2139.5.camel@domain.hid>
Hi Philippe,
On 06/09/2011 03:05 PM, Philippe Gerum wrote:
> On Thu, 2011-06-09 at 14:42 +0200, Wolfgang Grandegger wrote:
>> Hello,
>>
>> I just realized a problem with synchronous message passing support. When
>> rt_task_send() send times out, I get the oops below from line:
>>
>
> Does this help?
>
> diff --git a/ksrc/skins/native/task.c b/ksrc/skins/native/task.c
> index b822fd0..b0e99a7 100644
> --- a/ksrc/skins/native/task.c
> +++ b/ksrc/skins/native/task.c
> @@ -1988,21 +1988,28 @@ int rt_task_receive(RT_TASK_MCB *mcb_r, RTIME timeout)
> }
>
> /*
> - * Wait on our receive slot for some client to enqueue itself
> - * in our send queue.
> + * We loop to care for spurious wakeups, in case the
> + * client times out before we unblock.
> */
> - info = xnsynch_sleep_on(&server->mrecv, timeout, XN_RELATIVE);
> - /*
> - * XNRMID cannot happen, since well, the current task would be the
> - * deleted object, so...
> - */
> - if (info & XNTIMEO) {
> - err = -ETIMEDOUT; /* Timeout. */
> - goto unlock_and_exit;
> - } else if (info & XNBREAK) {
> - err = -EINTR; /* Unblocked. */
> - goto unlock_and_exit;
> - }
> + do {
> + /*
> + * Wait on our receive slot for some client to enqueue
> + * itself in our send queue.
> + */
> + info = xnsynch_sleep_on(&server->mrecv, timeout, XN_RELATIVE);
> + /*
> + * XNRMID cannot happen, since well, the current task
> + * would be the deleted object, so...
> + */
> + if (info & XNTIMEO) {
> + err = -ETIMEDOUT; /* Timeout. */
> + goto unlock_and_exit;
> + }
> + if (info & XNBREAK) {
> + err = -EINTR; /* Unblocked. */
> + goto unlock_and_exit;
> + }
> + } while (!xnsynch_pended_p(&server->mrecv));
>
> holder = getheadpq(xnsynch_wait_queue(&server->msendq));
> /* There must be a valid holder since we waited for it. */
Yes, it does help:
-bash-3.2# ./oops_sender
pre-rt_task_receive()
rt_task_send() failed: -110 (Connection timed out)
Killing child
No more oops, thanks for your quick help.
Wolfgang.
next prev parent reply other threads:[~2011-06-09 13:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 12:42 [Xenomai-core] Oops with synchronous message passing support Wolfgang Grandegger
2011-06-09 13:05 ` Philippe Gerum
2011-06-09 13:34 ` Wolfgang Grandegger [this message]
2011-06-09 13:48 ` 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=4DF0CBDA.9080300@domain.hid \
--to=wg@domain.hid \
--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.