PHP :: Bug #38542 :: proc_get_status : wrong PID
| Bug #38542 | proc_get_status : wrong PID | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2006-08-22 09:25 UTC | Modified: | 2006-12-31 14:47 UTC |
|
||||||||||
| From: | php at bouchery dot com | Assigned: | nlopess (profile) | |||||||||||
| Status: | Closed | Package: | Program Execution | |||||||||||
| PHP Version: | 5.1.5 | OS: | Windows | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2006-08-22 09:25 UTC] 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.
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2006-08-22 13:10 UTC] php at bouchery dot com
[2006-12-31 00:15 UTC] nlopess@php.net
[2006-12-31 14:47 UTC] nlopess@php.net