#36427 [Opn->Ver]: proc_open() / proc_close() leak handles on Windows XP

From: Date: Sun, 19 Feb 2006 00:39:00 +0000
Subject: #36427 [Opn->Ver]: proc_open() / proc_close() leak handles on Windows XP
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-93412@lists.php.net to get a copy of this message
ID: 36427 Updated by: nlopess@php.net Reported By: pgj at ds-fr dot com -Status: Open +Status: Verified Bug Type: Program Execution Operating System: windows XP SP2 Windows 2000 SP4 PHP Version: 4.4.2 New Comment: While I can reproduce the problem, I couldn't spot the error at first sight, because the code is very complex (and without valgrind even worst..) Previous Comments: ------------------------------------------------------------------------ [2006-02-17 15:35:06] pgj at ds-fr dot com 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 this bug report at http://bugs.php.net/?id=36427&edit=1

« previous php.bugs (#93412) next »