From: Jan Kiszka <jan.kiszka@domain.hid>
To: Jacques GANGLOFF <jacques@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] -EINTR using rt_pipe_read with TM_INFINITE
Date: Thu, 10 Aug 2006 01:19:53 +0200 [thread overview]
Message-ID: <44DA6D99.9090502@domain.hid> (raw)
In-Reply-To: <58356.127.0.0.1.1155128979.squirrel@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 1644 bytes --]
Jacques GANGLOFF wrote:
> Hi,
>
> I did this little test :
>
> Below I have attached two sources, one on the kernel side and one on the
> user side.
> I do here a very simple fifo handshaking test. I insert the kernel module
> then I run the user program. When I do the test with the "THE BUG IS HERE"
> line commented, I got :
>
> root@domain.hid# ./user
> user : j'ai envoyé A
> user :j'ai bien reçu E
> root@domain.hid# dmesg
> hello world
> kernel : j'ai bien reçu A
> kernel : ret = 1
> kernel :j'ai envoyé E
>
> Now, when I uncomment the line :
> root@domain.hid# ./user
> user : j'ai envoyé A
> [CRTL-C] because the user program is blocking ...
> root@domain.hid# dmesg
> hello world
> kernel : j'ai bien reçu A
> kernel : ret = -4
> kernel :j'ai envoyé E
>
That looks like a correct behaviour to me: the kernel module is trying
to read from pipe1 (MyPipe0, /dev/rtp0) and is blocked on it. The
user-space tool tries to do the same (is this intended BTW?). Then the
user-space program gets terminate, thus pipe1 is cleaned up. During that
cleanup all RT-readers on the pipe are woken up with -EINTR as return
code [1].
>
> Now, ret=-4 is the code for -EINTR. According to the doc :
> "-EINTR is returned if rt_task_unblock() has been called for the waiting
> task before any data was available."
>
> I cannot see where rt_task_unblock() could be called. What is wrong ?
>
Ok, the documentation is insufficient here. We should actually add the
second reason for EINTR as sketched above.
Jan
[1]http://www.rts.uni-hannover.de/xenomai/lxr/source/ksrc/nucleus/pipe.c#L607
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
next prev parent reply other threads:[~2006-08-09 23:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-09 13:09 [Xenomai-core] -EINTR using rt_pipe_read with TM_INFINITE Jacques GANGLOFF
2006-08-09 23:19 ` Jan Kiszka [this message]
2006-08-10 16:43 ` Jacques GANGLOFF
2006-08-10 14:59 ` Dmitry Adamushko
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=44DA6D99.9090502@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=jacques@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.