#30186 [Fbk->NoF]: passing empty string to xml_parser_create causes 100% CPU utilization
| From: | php-bugs at lists dot php dot net | Date: | Sun, 20 Feb 2005 00:00:10 +0000 |
| Subject: | #30186 [Fbk->NoF]: passing empty string to xml_parser_create causes 100% CPU utilization | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-74299@lists.php.net to get a copy of this message | ||
ID: 30186
Updated by: php-bugs@lists.php.net
Reported By: johnkarl at nbnet dot nb dot ca
-Status: Feedback
+Status: No Feedback
Bug Type: XML related
Operating System: Windows 2000 Professional SP4
PHP Version: 5.0.1
New Comment:
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
Previous Comments:
------------------------------------------------------------------------
[2005-02-12 22:50:00] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
------------------------------------------------------------------------
[2004-09-27 20:23:11] johnkarl at nbnet dot nb dot ca
Just tried it out with the snapshot you provided and still the same
problem. Here are my specs:
Windows 2004 Professional SP4
Apache/2.0.49
My workaround is to check the PHP version, and omit the empty string
parameter if version >= 5
This isn't an isolated problem, either. I became aware of this through
several individuals using my open source libraries. I'm not certain
what they were running but I can proably find out if you can't
replicate the problem.
John
------------------------------------------------------------------------
[2004-09-27 19:47:43] iliaa@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
Seems to work fine in recent code.
------------------------------------------------------------------------
[2004-09-21 21:11:55] johnkarl at nbnet dot nb dot ca
Description:
------------
In PHP5, if xml_parser_create is called with an empty string as the
character encoding parameter, a server will utilize 100% of the CPU.
Restarting Apache will sometimes cause the system to revert to normal,
but usually a reboot is needed.
In PHP4, calling xml_parser_create("") will cause Expat to autodetect
the character encoding. In the user comments of www.php.net, this is
purportedly true of PHP5 as well; however this is not the case.
This problem has been reproduced on a number of other machines as well.
I'm not sure if the same happens with IIS.
Reproduce code:
---------------
$parser = xml_parser_create("");
Expected result:
----------------
a reference to the parser should be returned
Actual result:
--------------
Apache stalls, 100% CPU usage
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30186&edit=1