[Python-bugs-list] [ python-Bugs-423472 ] Hang in select.select() and time.sleep()

noreply@sourceforge.net noreply@sourceforge.net
Tue, 29 May 2001 14:57:08 -0700


Bugs item #423472, was updated on 2001-05-11 17:20
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=423472&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Ralph Seguin (rpseguin)
Assigned to: Nobody/Anonymous (nobody)
Summary: Hang in select.select() and time.sleep()

Initial Comment:
Platform:  FreeBSD 4.0
Python version:   2.0 and 2.1  (maybe 1.5.2, haven't
tried)

There is a bug in the select() code that manifests
itself as a hang of the process if the system clock is
adjusted during a call to  select.select() or
time.sleep()  (which uses select())

I'm guessing that this might be related to the
reentrant., thread-safe libc_r.so used by the Python
runtime.


Steps to reproduce:

rseguin% python
Python 2.1 (#1, May 11 2001, 16:54:06)
[GCC 2.95 19990728 (release)] on freebsd4
Type "copyright", "credits" or "license" for more
information.
>>> import time
>>>
time.sleep(10.0)                                                            
(now set the system clock date/time via another shell)

Result is one of two things:
-ether  time.sleep()  (or select.select()) never comes
back
-OR it comes back after the time delta from previous
time before clock adjust and the adjusted time + the
desired sleep time interval.

This bug is more insidious than it may initially seem,
as there are any of a number of time adjusting daemons
(xntpd, ntpd, ...).  This is a nasty bug for daemon
style code in particular, as the daemon appears to be
running, while it is actually just hung.

This bug was in 2.0 and it is still there in 2.1

-Ralph
rpseguin@yahoo.com




----------------------------------------------------------------------

>Comment By: Jeremy Hylton (jhylton)
Date: 2001-05-29 14:57

Message:
Logged In: YES 
user_id=31392

What happens to a C program if you do the same?  I can't
tell if this is a Python bug or a C library bug, if indeed
it is a bug.  I'm not sure what these functions are supposed
to do when the clock is adjusted.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=423472&group_id=5470