All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] RTDM/POSIX - Select mask return value missing in case of timeout
@ 2012-12-11 14:07 alex alex
  2012-12-11 14:13 ` alex alex
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: alex alex @ 2012-12-11 14:07 UTC (permalink / raw)
  To: xenomai

Hi,


The problem is the following:


When the timeout interval expires of the “select” function the return value
of FD_ISSET(fdr,&readfds) is 1 whereas it should be 0.

In ksrc/skins/posix/syscall.c we can see that they are not copy to
userspace of select return value in case of timeout.



The attached code shows this bug with the use of a rtdm driver.



Alex.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai] RTDM/POSIX - Select mask return value missing in case of timeout
  2012-12-11 14:07 [Xenomai] RTDM/POSIX - Select mask return value missing in case of timeout alex alex
@ 2012-12-11 14:13 ` alex alex
  2012-12-11 14:14 ` Roland Stigge
  2012-12-11 14:55 ` Gilles Chanteperdrix
  2 siblings, 0 replies; 5+ messages in thread
From: alex alex @ 2012-12-11 14:13 UTC (permalink / raw)
  To: xenomai

> Hi,
>
>
> The problem is the following:
>
>
> When the timeout interval expires of the “select” function the return
> value of FD_ISSET(fdr,&readfds) is 1 whereas it should be 0.
>
> In ksrc/skins/posix/syscall.c we can see that they are not copy to
> userspace of select return value in case of timeout.
>
>
>
> The attached code shows this bug with the use of a rtdm driver.
>
>
>
> Alex.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_rtdm_fd_isset.bz2
Type: application/x-bzip2
Size: 4426 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20121211/1af84383/attachment.bin>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai] RTDM/POSIX - Select mask return value missing in case of timeout
  2012-12-11 14:07 [Xenomai] RTDM/POSIX - Select mask return value missing in case of timeout alex alex
  2012-12-11 14:13 ` alex alex
@ 2012-12-11 14:14 ` Roland Stigge
  2012-12-11 14:55 ` Gilles Chanteperdrix
  2 siblings, 0 replies; 5+ messages in thread
From: Roland Stigge @ 2012-12-11 14:14 UTC (permalink / raw)
  To: alex alex; +Cc: xenomai

Hi,

On 12/11/2012 03:07 PM, alex alex wrote:
> When the timeout interval expires of the “select” function the return value
> of FD_ISSET(fdr,&readfds) is 1 whereas it should be 0.
> 
> In ksrc/skins/posix/syscall.c we can see that they are not copy to
> userspace of select return value in case of timeout.
> 
> The attached code shows this bug with the use of a rtdm driver.

I guess you are reporting the same issue you reported to Debian some
hours ago at:

http://bugs.debian.org/695657 (including attachment)

Since your attachment got removed from your xenomai mailing list mail on
the way to me, I'm putting this here just for reference.

Roland


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai] RTDM/POSIX - Select mask return value missing in case of timeout
  2012-12-11 14:07 [Xenomai] RTDM/POSIX - Select mask return value missing in case of timeout alex alex
  2012-12-11 14:13 ` alex alex
  2012-12-11 14:14 ` Roland Stigge
@ 2012-12-11 14:55 ` Gilles Chanteperdrix
       [not found]   ` <CAPpP=rOkGfB0Wixi4JcLbPAxKayptTJnGeJO4R_FFGtXJAXx8w@mail.gmail.com>
  2 siblings, 1 reply; 5+ messages in thread
From: Gilles Chanteperdrix @ 2012-12-11 14:55 UTC (permalink / raw)
  To: alex alex; +Cc: xenomai

On 12/11/2012 03:07 PM, alex alex wrote:
> Hi,
> 
> 
> The problem is the following:
> 
> 
> When the timeout interval expires of the “select” function the return value
> of FD_ISSET(fdr,&readfds) is 1 whereas it should be 0.
> 
> In ksrc/skins/posix/syscall.c we can see that they are not copy to
> userspace of select return value in case of timeout.
> 
> 
> 
> The attached code shows this bug with the use of a rtdm driver.

So, could you try making the obvious change in the code? Or do you need
me to send you the patch?

-- 
					    Gilles.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai] RTDM/POSIX - Select mask return value missing in case of timeout
       [not found]     ` <CAPpP=rPG6VBxi3TF9Lja7T2LGjMSSTSGcvbR7xTYdPi9omwDRw@mail.gmail.com>
@ 2012-12-11 17:15       ` alex alex
  0 siblings, 0 replies; 5+ messages in thread
From: alex alex @ 2012-12-11 17:15 UTC (permalink / raw)
  To: xenomai

Here is the patch;

--- syscall1.c    2012-12-11 18:08:31.000000000 +0100
+++ syscall.c    2012-12-11 13:48:24.000000000 +0100
@@ -2498,7 +2498,7 @@
                       &tv, sizeof(tv)))
             return -EFAULT;
     }
-    if (err > 0)
+    if (err >= 0)
         for (i = 0; i < XNSELECT_MAX_TYPES; i++)
             if (ufd_sets[i]
                 && __xn_copy_to_user((void __user *) ufd_sets[i],

2012/12/11 alex alex <duch.alexandre@gmail.com>

> Tested. It seems to work!
> Thank you.
> I add the patch...
>
>
>
> 2012/12/11 alex alex <duch.alexandre@gmail.com>
>
>> I made the changes and I'm recompiling the kernel, so it takes a little
>> time ...
>> I'll let you know as soon as I know if it works.
>>
>>
>> 2012/12/11 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
>>
>>> On 12/11/2012 03:07 PM, alex alex wrote:
>>> > Hi,
>>> >
>>> >
>>> > The problem is the following:
>>> >
>>> >
>>> > When the timeout interval expires of the “select” function the return
>>> value
>>> > of FD_ISSET(fdr,&readfds) is 1 whereas it should be 0.
>>> >
>>> > In ksrc/skins/posix/syscall.c we can see that they are not copy to
>>> > userspace of select return value in case of timeout.
>>> >
>>> >
>>> >
>>> > The attached code shows this bug with the use of a rtdm driver.
>>>
>>> So, could you try making the obvious change in the code? Or do you need
>>> me to send you the patch?
>>>
>>> --
>>>                                             Gilles.
>>>
>>
>>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-12-11 17:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-11 14:07 [Xenomai] RTDM/POSIX - Select mask return value missing in case of timeout alex alex
2012-12-11 14:13 ` alex alex
2012-12-11 14:14 ` Roland Stigge
2012-12-11 14:55 ` Gilles Chanteperdrix
     [not found]   ` <CAPpP=rOkGfB0Wixi4JcLbPAxKayptTJnGeJO4R_FFGtXJAXx8w@mail.gmail.com>
     [not found]     ` <CAPpP=rPG6VBxi3TF9Lja7T2LGjMSSTSGcvbR7xTYdPi9omwDRw@mail.gmail.com>
2012-12-11 17:15       ` alex alex

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.