From: mike at silverorange dot com
Operating system: Windows
PHP version: 5.2.6
PHP Bug Type: Streams related
Bug description: stream_select on pipes returned by proc_open returns streams
that are not ready
Description:
------------
When using stream_select() on pipes returned by proc_open() in Windows,
input streams that are not ready are returned in the modified $read array.
Reproduce code:
---------------
<?php
$pipes = array();
$proc = proc_open('c:/progra~1/gnu/gnupg/gpg.exe', array(
0 => array('pipe', 'r'),
1 => array('pipe', 'w'),
2 => array('pipe', 'w')), $pipes, null, $_ENV);
if ($proc !== false) {
$write = array($pipes[0]);
$read = array($pipes[1], $pipes[2]);
$except = null;
$changed = stream_select($read, $write, $except, null);
if ($changed) {
print_r($read);
print_r($write);
}
proc_close($proc);
}
?>
Expected result:
----------------
The read array will be empty and the write array will contain stdin.
Actual result:
--------------
The read array contains stdin and the write array contains stdout and
stderr. The stdout and stderr streams have no data ready and fread() will
block indefinitely.
--
Edit bug report at http://bugs.php.net/?id=44908&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=44908&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=44908&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=44908&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44908&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=44908&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44908&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44908&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44908&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44908&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44908&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=44908&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=44908&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44908&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44908&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44908&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44908&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44908&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44908&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44908&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44908&r=mysqlcfg