php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23274 php starts using 99% of CPU when script is aborted
Submitted: 2003-04-18 15:01 UTC Modified: 2003-04-19 11:15 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: spagmoid at yahoo dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.3.1 OS: WinXP
Private report: No CVE-ID: None
 [2003-04-18 15:01 UTC] spagmoid at yahoo dot com
Using ignore_user_abort(true) and set_time_limit(0)
So the only way to abort the script is:

if(connection_status()!=0) die();

Well the script is using 1% of the CPU until I hit abort, then it jumps up to 99% and WILL NOT DIE.  Effectively killing the server.  I don't know if connection_status() is working or not, but if its not the script should just continue using 1% of the CPU.  So what's the problem?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-18 16:48 UTC] spagmoid at yahoo dot com
OK confirming, this has nothing to do with connection_status(), although that isn't working either.
Take this code:

ignore_user_abort(true);
set_time_limit(0);
while(connection_status()==0)
{
    echo str_pad(" ", 3000);
    flush();
    sleep(1);
}

After aborting or closing the browser, the PHP process suddenly starts using 99% CPU.  It takes a few seconds to kick in, as if it's something to do with the output buffer.  If you replace the while line to while(1) it does the same thing.  99% of CPU for no reason.
 [2003-04-18 23:14 UTC] spagmoid at yahoo dot com
OK this seems to be fixed in that snapshot.

This snapshot is showing all headers at the top of every page.  Is that on purpose, and is there any way to turn that on in the release versions for testing?
 [2003-04-19 11:15 UTC] magnus@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 11:01:31 2024 UTC