From: pgj at ds-fr dot com
Operating system: windows XP SP2 Windows 2000 SP4
PHP version: 4.4.2
PHP Bug Type: Program Execution
Bug description: proc_open() / proc_close() leak handles on Windows XP
Description:
------------
I launch processes in a script and put stout in file
after more than 2000 processes and can't open a new one and have this
message.
It's similar with 30743 bit it uses 2 pipes for $fileDescriptors and in
this case it's a pipe and a file
Reproduce code:
---------------
<?
set_time_limit(6000);
$i=0;
mkdir(test);
while(1)
{
$i++;
echo("-$i--\n");
invoke($i);
}
function invoke($i)
{
$commandLine = "echo hello";
$fileDescriptors = array(
1 => array("pipe", "r"),
2 => array("file", "test/$i.txt","w")
);
$pipes = array();
$processHandle = proc_open($commandLine,$fileDescriptors, $pipes);
if (is_resource($processHandle))
{
fclose($pipes[1]);
proc_close($processHandle);
}
}
Expected result:
----------------
Open a new one
Actual result:
--------------
<b>Warning</b>: proc_open(test/2587.txt): failed to open stream: Too many
open files in <b>E:\cotcot\leak.php</b> on line <b>24</b><br />
--
Edit bug report at http://bugs.php.net/?id=36427&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36427&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36427&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36427&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36427&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36427&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36427&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36427&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36427&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36427&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36427&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36427&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36427&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36427&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36427&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36427&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36427&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36427&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36427&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36427&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36427&r=mysqlcfg