PHP 4.0 Bug #4505: httpd lockup (similar to bug #2315)
| From: | juhl at eisenstein dot dk | Date: | Thu, 18 May 2000 17:23:34 +0000 |
| Subject: | PHP 4.0 Bug #4505: httpd lockup (similar to bug #2315) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-18921@lists.php.net to get a copy of this message | ||
From: juhl@eisenstein.dk
Operating system: Slackware Linux 7.0
PHP version: 4.0 Release Candidate 2
PHP Bug Type: Scripting Engine problem
Bug description: httpd lockup (similar to bug #2315)
If I run a script containing a function with an infinite loop (like the code below) and then hit the
stop button in Netscape, httpd wil continue to consume somewhere between 93 and 99 % of my total CPU
cycles. This goes on forever until I restart httpd. You can force this behaviour in many ways, a
while ( 1 == 1 ) loop will also do nicely (anything that loops indefinately).
Here's a script that will show the bug:
------- Start of buggy PHP script -----------
<html>
<head>
<title>Buggy PHP script</title>
</head>
<body>
<?php
for ( ; ; ) {
print("Bug<br>\n");
}
?>
</body>
</html>
------- End of buggy PHP script -----------
Here's a dump from "top" showing httpd burning CPU cycles after running the script
above (top has been set to a refresh interval of one second):
PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND
454 nobody 17 0 46048 13M 1192 R 0 97.0 11.5 10:44 httpd
I know that the script is buggy, but I'd expect it to terminat when the browser stops loading
data from it - is this a wrong assumption?
My configure line for PHP 4.0RC2 looks like this
./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs --with-config-file-path=/etc/httpd
--enable-calendar --enable-trans-sid --enable-versioning --enable-track-vars
If you need my php.ini file - just ask, I'll email it upon request.
Best regards
Jesper Juhl