|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35900 stream_select() should warning when tv_sec is negative
Submitted: 2006-01-05 03:39 UTC Modified: 2006-04-19 08:44 UTC
From: sqchen at citiz dot net Assigned:
Status: Closed Package: Streams related
PHP Version: 5.1.1 OS: redhat 7.3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: sqchen at citiz dot net
New email:
PHP Version: OS:


 [2006-01-05 03:39 UTC] sqchen at citiz dot net
int stream_select ( array &read, array &write, array &except, int tv_sec [, int tv_usec] )

when tv_sec= -1, tv_usec=6000000, it should warning, not wait 5 seconds.

Reproduce code:
$read = array(STDIN);
if($num_changed_streams = stream_select($read, $write=NULL , $except = NULL, -1,6000000))
        echo "Pass";
        echo "Fail";

Expected result:
warning: Invalid argument (max_fd=0) 

Actual result:
wait 5 seconds for input


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-05 10:05 UTC]
Please try using this CVS snapshot:
For Windows:

 [2006-01-15 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-02-23 03:26 UTC] sqchen at citiz dot net
sorry for my late response, I have tried the cvs version, and the problem remains as before
 [2006-02-23 19:28 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

 [2006-04-19 08:36 UTC] sqchen at citiz dot net
hi. I have tried it with the snapshot version and found that it's actully  not fixed correctory..

file: streamsfuncs.c 
line: 757

while sec here is a address, so it should be:
if (Z_LVAL(*sec) < 0).......
 [2006-04-19 08:44 UTC]
Fixed in CVS.
Thanks for noticing.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 03:01:33 2024 UTC