From:             terrafrost at gmail dot com
Operating system: Windows XP
PHP version:      4.3.9
PHP Bug Type:     Reproducible crash
Bug description:  popen crashes webservers

Description:
------------
When run from a webserver, the following two scripts cause the webserver
to crash.  In contrast, no such problem occurs when these scripts are run
from the command line.

Reproduce code:
---------------
ptest.php:
<?
   $p1 = popen("c:\\php\\php -q hello.php","r");
   $p2 = popen("c:\\php\\php -q hello.php","r");
   while (!feof($p1))
      print fgets($p1);
   while (!feof($p2))
      print fgets($p2);
   pclose($p1);
   pclose($p2);
?>

and

hello.php:
<?
   print "hello,\nworld!\n";
?>

Expected result:
----------------
I expect the following to be displayed:

hello,
world!
hello,
world!

Actual result:
--------------
When run from the command line, the expected result is the actual result. 
However, when run from a webserver (I tried Apache 2.0.52 and Abyss Web
Server 1.2.3.0) they create a bunch of php and cmd processes (more than it
should) and none of them are terminated.

In the case of Apache, processes are no longer created after the first 10
or so are.  Afterwards, trying to view php scripts, with Apache, causes an
Internal Server Error.  

In the case of Abyss, processes are no longer created when the system has
run out of ram.

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

Reply via email to