php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4505 httpd lockup (similar to bug #2315)
Submitted: 2000-05-18 13:23 UTC Modified: 2000-07-26 00:12 UTC
From: juhl at eisenstein dot dk Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Release Candidate 2 OS: Slackware Linux 7.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: juhl at eisenstein dot dk
New email:
PHP Version: OS:

 

 [2000-05-18 13:23 UTC] juhl at eisenstein dot dk
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-26 00:12 UTC] zak@php.net
Please try a recent release of PHP and ensure that the max_execution_time and memory_limit directives are set to reasonable values.  If the problem re-occurs, please submit a new bug report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 28 21:01:26 2024 UTC