All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Levesque <vleves@domain.hid>
To: xenomai@xenomai.org
Cc: andrewg@domain.hid
Subject: [Xenomai-help] -110 error on rt_task_send... bug?
Date: Mon, 07 Aug 2006 21:50:07 -0400	[thread overview]
Message-ID: <44D7EDCF.9010409@domain.hid> (raw)

Hello,

I'm having some problems with rt_task_send/receive/reply in the native 
skin. The code attached at the end of this email works fine on Xenomai 
2.1 but rt_task_send() fails with error message -110 on Xenomai 2.2.0 
and today's subversion trunk. I checked the error values of all other 
calls (removed for clarity) and everything seems to be ok. The -110 
error code is returned either when rt_task_send() times out or when 
rt_task_reply() is called, whichever comes first. If I set it to 
TM_INFINITE, rt_task_send() never returns and the system hangs when I 
press control-c. I've reproduced this behavior on two computers.

Am I doing something wrong that was tolerated by 2.1? Is this a bug in 
Xenomai 2.2?

Thank you,

Vincent Levesque
vleves@domain.hid



gcc -o test test.c `/usr/xenomai/bin/xeno-config --xeno-cflags` -O2 
`/usr/xenomai/bin/xeno-config --xeno-ldflags` -lnative

--------------------------------------------------------
test.c
--------------------------------------------------------

#include <stdio.h>
#include <sys/mman.h>
#include <native/task.h>

void recv_task(void *arg)
{
    RT_TASK_MCB mcb_receive;
    int flowid;
    int data;

    mcb_receive.data = (caddr_t)&data;
    mcb_receive.size = sizeof(int);
    flowid = rt_task_receive(&mcb_receive,TM_INFINITE);
    if (mcb_receive.opcode == 1)
    {
        printf("receiving %d\n", data);
        rt_task_reply(flowid, NULL);
    }
}

int main (int argc, char *argv[])
{
    int data, rv;
    RT_TASK_MCB mcb_send;
    RT_TASK peer;
    RT_TASK task;

    mlockall(MCL_CURRENT | MCL_FUTURE);

    rt_task_spawn(&peer, "recv_task", 0, 99, T_FPU, &recv_task, NULL);
    rt_task_shadow(&task, "send_task", 50, 0);

    data = 13;
    mcb_send.opcode = 1;
    mcb_send.data = (caddr_t)&data;
    mcb_send.size = sizeof(int);

    printf("sending %d\n", data);
    rv = rt_task_send(&peer,&mcb_send,NULL,1E9);
    if (rv < 0)
    {
        switch(rv)
        {
            case -ENOBUFS:        printf("ENOBUFS\n");
            case -EWOULDBLOCK:    printf("EWOULDBLOCK\n");
            case -EIDRM:        printf("EIDRM\n");
            case -EINTR:        printf("EINTR\n");
            case -EPERM:        printf("EPERM\n");
            default:            printf("unknown error: %d\n", rv);
        }
    }

    rt_task_delete(&peer);
    return 0;
}



             reply	other threads:[~2006-08-08  1:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-08  1:50 Vincent Levesque [this message]
2006-08-08 22:12 ` [Xenomai-help] -110 error on rt_task_send... bug? Jan Kiszka
2006-08-09  9:35   ` Dmitry Adamushko
2006-08-09 11:42     ` [Xenomai-core] " Dmitry Adamushko
2006-08-09 15:09       ` Ulrich Schwab
2006-08-09 15:42         ` Dmitry Adamushko
2006-08-10 18:14           ` Vincent Levesque
2006-08-10 18:18             ` Dmitry Adamushko
2006-08-10  8:25         ` Jan Kiszka
2006-08-10 10:11           ` Dmitry Adamushko
2006-08-10 22:13     ` Philippe Gerum
2006-08-11  7:50       ` Dmitry Adamushko
2006-08-12 10:33       ` Dmitry Adamushko
2006-08-12 21:14         ` Philippe Gerum
2006-08-13 14:47           ` Philippe Gerum
2006-08-13 20:24             ` 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=44D7EDCF.9010409@domain.hid \
    --to=vleves@domain.hid \
    --cc=andrewg@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.