History log of /php-src/ext/standard/tests/streams/gh16889.phpt (Results 1 – 1 of 1)
Revision Date Author Comments
# b614b4a6 24-Nov-2024 Christoph M. Becker

GH-16889: stream_select() timeout useless for pipes on Windows

Pipes are blocking on Windows, but `php_select()` always returns them
as ready for read/write. This renders the `stream_se

GH-16889: stream_select() timeout useless for pipes on Windows

Pipes are blocking on Windows, but `php_select()` always returns them
as ready for read/write. This renders the `stream_select()` timeout
useless, what can cause a following read to block for a very long time.

While there is no general fix (and least not within reach for a stable
version), we can at least cater to the important case of read pipes by
peeking the pipe to check whether data is available. If there is none,
we do not add the handle to the read set.

We need to fix a couple of tests cases:

* bug60692.phpt and bug64770.phpt assume that at least the stdin and
stdout pipes are always selected as readable, and that the select
call will not change their order. We're being more defensive now.
* the potentials warnings of bug49936_win32.phpt need to be suppressed,
like it has been done earlier for the POSIX variant of this test
case[1]. Possibly this test case should be dropped altogether[2].

[1] <https://github.com/php/php-src/commit/c884d3782c1e9bc9f4210bea8a28258bfab3ca2e>
[2] <https://github.com/php/php-src/commit/2c6b85f6fe68429a3babbe33575b3ce14055f0ce>

Closes GH-16917.

show more ...