From: php-bugs at dennis dot birkholz dot biz
Operating system: Linux
PHP version: 5.4.11
Package: Streams related
Bug Type: Bug
Bug description:proc_open: all file handles are connected to same pty
Description:
------------
If you open a program with proc_open and you connect both stdout and stderr
of that program to a pty, the same pty is used. If you use select_stream on
both stdout and stderr, select marks both as ready and you can not
distinguish which one hash data as you can read from both resources.
Test script:
---------------
$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pty"),
2 => array("pty"),
);
$proc = proc_open("programpath", $descriptorspec, $handles = array());
stream_select($read = array($handles[1], $handles[2]), $write = null,
$urgent = null, $timeout = 10);
// $read now contains $handles[1] AND $handles[2], does not matter where
the data was written to
--
Edit bug report at https://bugs.php.net/bug.php?id=64179&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=64179&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=64179&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=64179&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64179&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64179&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64179&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64179&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64179&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64179&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64179&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64179&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64179&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64179&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64179&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64179&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64179&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64179&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64179&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64179&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64179&r=mysqlcfg