From: riku at palomaki dot fi
Operating system: Linux
PHP version: 5.1.4
PHP Bug Type: DOM XML related
Bug description: DOMElement->setAttribute() loops forever (node_list_unlink
bug?)
Description:
------------
That another setAttribute() -call never finishes, and the script will just
eventually die because of "PHP Fatal error: Maximum execution time.." I
have tried this with cgi and cli versions of PHP 5.1.4, 5.1.1 and 5.0.5 on
different servers (and different ISPs).
When running, php-process takes all CPU. I tried to debug it with gdb and
node_list_unlink seems to be calling itself forever.
Reproduce code:
---------------
$doc = new DOMDocument();
$doc->resolveExternals = true;
$doc->loadXml('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><a b="" />');
$root = $doc->getElementsByTagName('a')->item(0);
$root->setAttribute('b', '>');
$root->setAttribute('b', '');
// This will never be executed
echo "done\n";
Expected result:
----------------
Script prints "done\n"
Actual result:
--------------
Fatal error: Maximum execution time of 180 seconds exceeded in phpbug.php
on line 8 (that is the another setAttribute-call)
--
Edit bug report at http://bugs.php.net/?id=37456&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=37456&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=37456&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=37456&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37456&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=37456&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37456&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37456&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37456&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37456&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37456&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=37456&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=37456&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37456&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37456&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37456&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37456&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37456&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37456&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37456&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37456&r=mysqlcfg