From: vesely at tana dot it
Operating system: Unix
PHP version: 4.4.0
PHP Bug Type: Reproducible crash
Bug description: processes opened with proc_open may freeze on fatal error
Description:
------------
If the proc_open was inside a class object,
then on a fatal error the child process
is not killed. (Both CLI and Apache.)
That behaviour makes it difficult to develop
scripts based on classes using proc_open.
If the $proc is not inside a class object,
I obtained a similar freezing doing $proc = 0
before the fatal error.
Reproduce code:
---------------
<?php
class my_class
{
var $proc, $pipes;
function my_class() {
$this->proc = proc_open("cat -",
array(
0 => array("pipe", "r"),
1 => array("file", "/dev/null", "w"),
2 => array("file", "/dev/null", "w")),
$this->pipes);
}
}
$p = new my_class();
printf("%s proc hangs on fatal PHP error?\n",
is_resource($p->proc) ? "Open" : "Not open");
non_existing_function("hangs if open");
// not reached...
?>
--
Edit bug report at http://bugs.php.net/?id=33828&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33828&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=33828&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=33828&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33828&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33828&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33828&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33828&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33828&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33828&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33828&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=33828&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=33828&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33828&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33828&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33828&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33828&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33828&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33828&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33828&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33828&r=mysqlcfg