#19081 [Fbk->Csd]: crashes when doing lots of get_elements_by_tagname

From: Date: Tue, 27 Aug 2002 21:29:46 +0000
Subject: #19081 [Fbk->Csd]: crashes when doing lots of get_elements_by_tagname
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17969@lists.php.net to get a copy of this message
ID: 19081 User updated by: KingGeoffrey@yahoo.com Reported By: KingGeoffrey@yahoo.com -Status: Feedback +Status: Closed Bug Type: DOM XML related Operating System: WinNT PHP Version: 4.2.2 New Comment: fixed by - 4.2.3 - dev Previous Comments: ------------------------------------------------------------------------ [2002-08-27 01:36:39] chregu@php.net The correct link is: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip ------------------------------------------------------------------------ [2002-08-27 01:35:57] chregu@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip Aditionally you can try a stable-snapshot, which should solve this problem, too. http://snaps.php.net/win32/php4-win32-stable.zip chregu ------------------------------------------------------------------------ [2002-08-24 04:38:35] KingGeoffrey@yahoo.com 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 this bug report at http://bugs.php.net/?id=19081&edit=1

« previous php.bugs (#17969) next »