From: johnkarl at nbnet dot nb dot ca Operating system: Windows 2000 Professional SP4 PHP version: 5.0.1 PHP Bug Type: XML related Bug description: passing empty string to xml_parser_create causes 100% CPU utilization
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 bug report at http://bugs.php.net/?id=30186&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30186&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30186&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30186&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30186&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30186&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30186&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30186&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30186&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30186&r=support Expected behavior: http://bugs.php.net/fix.php?id=30186&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30186&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30186&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30186&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30186&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30186&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30186&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30186&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30186&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30186&r=mysqlcfg