|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38542 proc_get_status : wrong PID
Submitted: 2006-08-22 09:25 UTC Modified: 2006-12-31 14:47 UTC
Avg. Score:4.3 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (33.3%)
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: php at bouchery dot com
New email:
PHP Version: OS:


 [2006-08-22 09:25 UTC] php at bouchery dot com
proc_get_status return the wrong PID

Reproduce code:
$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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-22 13:05 UTC]
Please try using this CVS snapshot:
For Windows:

 [2006-08-22 13:10 UTC] 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-12-31 00:15 UTC]
problem verified. it is returning hProcess instead of dwProcessId of the PROCESS_INFORMATION structure. I'll patch it.
 [2006-12-31 14:47 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 05 11:01:28 2024 UTC