#19081 [NEW]: crashes when doing lots of get_elements_by_tagname
| From: | KingGeoffrey at yahoo dot com | Date: | Sat, 24 Aug 2002 08:38:36 +0000 |
| Subject: | #19081 [NEW]: crashes when doing lots of get_elements_by_tagname | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-17746@lists.php.net to get a copy of this message | ||
From: KingGeoffrey@yahoo.com
Operating system: WinNT
PHP version: 4.2.2
PHP Bug Type: DOM XML related
Bug description: crashes when doing lots of get_elements_by_tagname
The exact cause of the bug is not clear to me, i have pruned my code down
to something that reliably causes it both in cli and web server version.
To reproduce (i hope) put .php and .xml files in same and execute in cli
mode, it should crash as it completes.
Dr watson writes a dump file i can retrieve that if requested.
I am running unmodified win binaries 4.2.2 as distributed.
The two files are...
--- crash.php ---
<?php
function findNode($Doc, $TagName, $AttrName, $AttrValue) {
$nodes = $Doc->get_elements_by_tagname($TagName);
reset($nodes);
while (list($key, $value) = each($nodes)) {
if ($AttrValue == $value->get_attribute($AttrName))
return $value;
}
return null;
}
function save($XmlFile, $Username, $GameId) {
!$doc = domxml_open_file($XmlFile);
$user = findNode($doc, 'user', 'username', $Username);
echo ">";
if ($user)
$games = $user->child_nodes();
echo "<";
}
echo "php:" . phpversion() . " domxml:" . domxml_version() . "<br
/>\n";
for($i=0; $i < 40; $i++) {
save("crash.xml", "abc", "x");
}
?>
--- crash.xml ---
<?xml version="1.0" encoding="UTF-8"?>
<users>
<user username="abc">
<game id="game0"/>
<game id="game1"/>
<game id="game2"/>
<game id="game3"/>
<game id="game4"/>
<game id="game5"/>
<game id="game6"/>
<game id="game7"/>
<game id="game8"/>
<game id="game9"/>
<game id="game10"/>
<game id="game11"/>
<game id="game12"/>
<game id="game13"/>
<game id="game14"/>
<game id="game15"/>
<game id="game16"/>
<game id="game17"/>
<game id="game18"/>
<game id="game19"/>
<game id="game20"/>
<game id="game21"/>
<game id="game22"/>
<game id="game23"/>
<game id="game24"/>
<game id="game25"/>
<game id="game26"/>
<game id="game27"/>
<game id="game28"/>
<game id="game29"/>
<game id="game30"/>
<game id="game31"/>
<game id="game32"/>
<game id="game33"/>
<game id="game34"/>
<game id="game35"/>
<game id="game36"/>
<game id="game37"/>
<game id="game38"/>
<game id="game39"/>
</user>
</users>
--
Edit bug report at http://bugs.php.net/?id=19081&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19081&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19081&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19081&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19081&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19081&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19081&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19081&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19081&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19081&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19081&r=globals