Bug 619664 - [CentOS 5.5] select()'s timeout breaks POSIX spec
Summary: [CentOS 5.5] select()'s timeout breaks POSIX spec
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.5
Hardware: i386
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Red Hat Kernel Manager
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-30 05:59 UTC by Sam Trenholme
Modified: 2013-03-16 23:13 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-27 11:30:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sam Trenholme 2010-07-30 05:59:05 UTC
Description of problem:

The select() system call takes twice as long to timeout as it should.

Version-Release number of selected component (if applicable):

CentOS 5.5 (regression; CentOS 5.4 is fine)

How reproducible:

Always reproducible.

Steps to Reproduce:
1. cat > select.delay.c << EOF
/* Tiny program to show CentOS 5.5 bug. Public domain */

#include <sys/select.h>
#include <stdio.h>

main() {
        struct timeval tv;
        tv.tv_sec = 1;
        tv.tv_usec = 0;
        select(0,NULL,NULL,NULL,&tv);
        return 0;
}
EOF 
2. cc -o select.delay select.delay.c
3. time ./select.delay
  
Actual results:

Numbers along these lines:

real 0m2.002s
user 0m0.000s
sys 0m0.005s

Expected results:

Numbers like this:

real 0m1.098s
user 0m0.000s
sys 0m0.000s

Additional info:

This is a bug because the POSIX specification for "select()" at http://www.opengroup.org/onlinepubs/000095399/functions/select.html states that "the timeout period is given in seconds and microseconds" and the POSIX specification for "time.h" at http://www.opengroup.org/onlinepubs/009695399/basedefs/time.h.html points out the tv_sec is seconds, e.g. "time_t tv_sec Seconds".

Comment 1 Sam Trenholme 2010-07-30 06:00:08 UTC
Originally submitted at http://bugs.centos.org/view.php?id=4465 and instructed to go upstream.  So, here I am.

Comment 2 Jes Sorensen 2013-02-27 11:30:30 UTC
Upstream means going to the linux-kernel mailing list - Red Hat is not
upstream for this.

Please try the mailing list.

Comment 3 Sam Trenholme 2013-03-16 23:12:26 UTC
For what it is worth, this bug has been fixed in CentOS 5.9.

Comment 4 Sam Trenholme 2013-03-16 23:13:09 UTC
Closing as "works for me"


Note You need to log in before you can comment on or make changes to this bug.