#30186 [Opn->Fbk]: passing empty string to xml_parser_create causes 100% CPU utilization

From: Date: Mon, 27 Sep 2004 17:47:45 +0000
Subject: #30186 [Opn->Fbk]: 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-66770@lists.php.net to get a copy of this message
ID: 30186 Updated by: iliaa@php.net Reported By: johnkarl at nbnet dot nb dot ca -Status: Open +Status: Feedback Bug Type: XML related Operating System: Windows 2000 Professional SP4 PHP Version: 5.0.1 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#66770) next »