#47763 [NEW]: proc_get_status->wrong PID

From: Date: Tue, 24 Mar 2009 15:44:01 +0000
Subject: #47763 [NEW]: proc_get_status->wrong PID
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-135058@lists.php.net to get a copy of this message
From: ies_clan at hotmail dot com Operating system: Windows XP SP3 PHP version: 5.2.9 PHP Bug Type: Filesystem function related Bug description: proc_get_status->wrong PID Description: ------------ The function proc_get_status returns a wrong PID Reproduce code: --------------- <?php $cmd = 'notepad'; $descriptorspec = array( 0 => array('pipe', 'r' ), 1 => array('pipe', 'w' ), 2 => array('pipe', 'w' ) ); $process = proc_open($cmd, $descriptorspec, $pipes); $status = proc_get_status( $process ); echo 'PID = ', $status['pid'], "\n"; passthru( 'tasklist /fi "imagename eq notepad.exe"'); echo "\n\n"; passthru( 'tasklist /fi "pid eq ' . $status['pid'] . '"' ); echo "\n\n"; proc_terminate($process); ?> Expected result: ---------------- PID = 2408 Abbildname PID Sitzungsname Sitz.-Nr. Speichernutzung ========================= ===== ================ ========== =============== notepad.exe 2408 Console 0 2.560 K Abbildname PID Sitzungsname Sitz.-Nr. Speichernutzung ========================= ===== ================ ========== =============== cmd.exe 2336 Console 0 2.560 K Actual result: -------------- PID = 2336 Abbildname PID Sitzungsname Sitz.-Nr. Speichernutzung ========================= ===== ================ ========== =============== notepad.exe 2408 Console 0 2.560 K Abbildname PID Sitzungsname Sitz.-Nr. Speichernutzung ========================= ===== ================ ========== =============== cmd.exe 2336 Console 0 2.560 K -- Edit bug report at http://bugs.php.net/?id=47763&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47763&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47763&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47763&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47763&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47763&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47763&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47763&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47763&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47763&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47763&r=support Expected behavior: http://bugs.php.net/fix.php?id=47763&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47763&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47763&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47763&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47763&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=47763&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47763&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47763&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47763&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47763&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47763&r=mysqlcfg

« previous php.bugs (#135058) next »