#32861 [NEW]: timeout is ignored in stream_select function
| From: | lew at mailduct dot com | Date: | Wed, 27 Apr 2005 19:53:45 +0000 |
| Subject: | #32861 [NEW]: timeout is ignored in stream_select function | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-78311@lists.php.net to get a copy of this message | ||
From: lew at mailduct dot com
Operating system: FreeBSD 4.11-REL
PHP version: 4.3.10
PHP Bug Type: Filesystem function related
Bug description: timeout is ignored in stream_select function
Description:
------------
Timeouts are ignored in stream_select. Instead, it always
returns with "1" as the number of streams affected, ignoring
any timeout seconds that are set.
This is true regardless of stream_set_blocking settings.
This may or may not be related to my reported FEOF problems:
pr #25649 (Sep 2003)
pr #32858 (Apr 2005)
Reproduce code:
---------------
$fp = fopen( '/var/log/maillog','r' );
## Tried both ways, got same results
#stream_set_blocking( $fp,TRUE );
#stream_set_blocking( $fp,FALSE );
$r = array( $fp );
while( TRUE ) {
$n = stream_select( $r,$w=NULL,$e=NULL,30 );
if( $n===FALSE ) echo "stream_select = FALSE\n";
else echo "stream_select = $n\n";
echo fgets($fp);
print( '.' );
}
Expected result:
----------------
Assuming no other program is writing to /var/log/maillog, I expect to see
a timeout condition every 30 seconds, as such:
stream_select = FALSE
Actual result:
--------------
Instead, I see iterations of:
stream_select = 1
as fast as the system can execute the loop.
--
Edit bug report at http://bugs.php.net/?id=32861&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32861&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32861&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32861&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32861&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32861&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32861&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32861&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32861&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32861&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32861&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32861&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32861&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32861&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32861&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32861&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32861&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32861&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32861&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32861&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32861&r=mysqlcfg