#38542 [Asn->Csd]: proc_get_status : wrong PID

From: Date: Sun, 31 Dec 2006 14:47:19 +0000
Subject: #38542 [Asn->Csd]: proc_get_status : wrong PID
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-107061@lists.php.net to get a copy of this message
ID: 38542 Updated by: nlopess@php.net Reported By: php at bouchery dot com -Status: Assigned +Status: Closed Bug Type: Program Execution Operating System: Windows PHP Version: 5.1.5 Assigned To: nlopess New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2006-12-31 00:15:21] nlopess@php.net problem verified. it is returning hProcess instead of dwProcessId of the PROCESS_INFORMATION structure. I'll patch it. ------------------------------------------------------------------------ [2006-08-22 13:10:27] php at bouchery dot com Same problem : PID = 1844 Image Name PID Session Name Session# Mem Usage ========================= ====== ================ ======== ============ notepad.exe 4432 Console 0 3 220 K INFO: No tasks running with the specified criteria. ------------------------------------------------------------------------ [2006-08-22 13:05:33] tony2001@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.2-win32-latest.zip ------------------------------------------------------------------------ [2006-08-22 09:25:52] php at bouchery dot com Description: ------------ proc_get_status return the 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"; ?> Expected result: ---------------- proc_get_status should return the notepad's PID Actual result: -------------- It returns a PID which doesn't exist or associate to a process which is not related to the script context. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38542&edit=1

« previous php.bugs (#107061) next »