From:             joh at deworks dot net
Operating system: Linux
PHP version:      5CVS-2005-03-07 (dev)
PHP Bug Type:     Filesystem function related
Bug description:  proc_get_status "running"-field true after execution of 
command

Description:
------------
The "running" field of the status array returned by proc_get_status() is
always TRUE after the execution of the command is finished. As the manual
says, running should be "TRUE if the process is still running, FALSE if it
has terminated". What is strange is that at some point of the command
execution, it's false. Maybe it's value is the opposite of what the manual
says?

Reproduce code:
---------------
(Best run from the command line)

$handle = proc_open("ls", array(2 => array("pipe", "r")), $pipes);

while (true) {
        $status = proc_get_status($handle);                             
var_dump($status["running"]);
        sleep(1);
}

Expected result:
----------------
bool(false)
<output of the command>
bool(true)
bool(false)
bool(false)
...

Actual result:
--------------
bool(true)
<output of the command>
bool(false)
bool(true)
bool(true)
...

-- 
Edit bug report at http://bugs.php.net/?id=32210&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32210&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32210&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32210&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32210&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32210&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32210&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32210&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32210&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32210&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32210&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32210&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32210&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32210&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32210&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32210&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32210&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32210&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32210&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32210&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32210&r=mysqlcfg

Reply via email to