Edit report at https://bugs.php.net/bug.php?id=64465&edit=1
ID: 64465 User updated by: andrey dot kalinovsky at gmail dot com Reported by: andrey dot kalinovsky at gmail dot com Summary: proc_get_status update time when using proc_terminate Status: Open Type: Bug Package: Program Execution Operating System: OSX, Ubuntu PHP Version: Irrelevant Block user comment: N Private report: N New Comment: This is a big issue when working with libev eventloop, since it's about handling child processes asynchronously. So, I can't just let the sleep(1) here, the solution must be asynchronous... Previous Comments: ------------------------------------------------------------------------ [2013-03-20 15:32:26] andrey dot kalinovsky at gmail dot com Description: ------------ After proc_terminate has been called, there is a time during which proc_get_status will still describe the child process as running. Test script: --------------- <?php $descriptorspec = array( 0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w") ); $process = proc_open("sleep 20", $descriptorspec, $pipes); var_dump(proc_get_status($process)); proc_terminate($process); var_dump(proc_get_status($process)); sleep(1); var_dump(proc_get_status($process)); Expected result: ---------------- array(8) { 'command' => string(8) "sleep 20" 'pid' => int(14027) 'running' => bool(true) 'signaled' => bool(false) 'stopped' => bool(false) 'exitcode' => int(-1) 'termsig' => int(0) 'stopsig' => int(0) } array(8) { 'command' => string(8) "sleep 20" 'pid' => int(14027) 'running' => bool(false) 'signaled' => bool(true) 'stopped' => bool(false) 'exitcode' => int(-1) 'termsig' => int(15) 'stopsig' => int(0) } array(8) { 'command' => string(8) "sleep 20" 'pid' => int(14027) 'running' => bool(false) 'signaled' => bool(true) 'stopped' => bool(false) 'exitcode' => int(-1) 'termsig' => int(15) 'stopsig' => int(0) } Actual result: -------------- array(8) { 'command' => string(8) "sleep 20" 'pid' => int(14027) 'running' => bool(true) 'signaled' => bool(false) 'stopped' => bool(false) 'exitcode' => int(-1) 'termsig' => int(0) 'stopsig' => int(0) } array(8) { 'command' => string(8) "sleep 20" 'pid' => int(14027) 'running' => bool(true) 'signaled' => bool(false) 'stopped' => bool(false) 'exitcode' => int(-1) 'termsig' => int(0) 'stopsig' => int(0) } array(8) { 'command' => string(8) "sleep 20" 'pid' => int(14027) 'running' => bool(false) 'signaled' => bool(true) 'stopped' => bool(false) 'exitcode' => int(-1) 'termsig' => int(15) 'stopsig' => int(0) } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=64465&edit=1