#18457 [Opn->Csd]: Crash with XPath
| From: | chregu@php.net | Date: | Mon, 05 Aug 2002 09:34:01 +0000 |
| Subject: | #18457 [Opn->Csd]: Crash with XPath | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-16002@lists.php.net to get a copy of this message | ||
ID: 18457
Updated by: chregu@php.net
Reported By: kelcon@ceti.pl
-Status: Open
+Status: Closed
Bug Type: DOM XML related
Operating System: Win98
PHP Version: 4.2.1
New Comment:
This bug should be fixed in HEAD and PHP_4_2_0 (stable) branch
get it from
http://snaps.php.net/win32/
chregu
Previous Comments:
------------------------------------------------------------------------
[2002-07-21 12:52:28] kelcon@ceti.pl
This code crashesh php (tested via php-cli). When $i less-then
condition is set to 100, this code works, but when is greater, it
crashes on exit.
$content = '<?xml version="1.0" encoding="utf-8"?>
<auth xmlns:dt="http://www.nowhere.pl/">
<dt:shadow name="rules" desc="Rules" zygryf="label"/>
<rules>
<dt:shadow name="rule" desc="Rule" multiple="1"
required="0"/>
<rule>
<dt:shadow name="expr" zygryf="text" desc="Match Expression"
zygryf-size="40"/>
<expr/>
<dt:shadow name="group" desc="Group" multiple="1"
required="0"/>
<group>
<dt:shadow name="name" zygryf="text" desc="Name"
zygryf-size="20"/>
<name/>
<dt:shadow name="read" zygryf="bool" desc="Read"/>
<read/>
<dt:shadow name="write" zygryf="bool" desc="Write"/>
<write/>
</group>
</rule>
</rules>
<dt:shadow name="default" desc="Default Rule" zygryf="label"/>
<default>
<dt:shadow name="group" desc="Group" multiple="1"
required="0"/>
<group>
<dt:shadow name="name" zygryf="text" desc="Name"
zygryf-size="20"/>
<name/>
<dt:shadow name="read" zygryf="bool" desc="Read"/>
<read/>
<dt:shadow name="write" zygryf="bool" desc="Write"/>
<write/>
</group>
</default>
</auth>
';
print microtime() . "\n";
$dom = domxml_open_mem($content);
for ($i = 0; $i < 300; $i++) {
$dom = domxml_open_mem($content);
$context = xpath_new_context ($dom);
$results = xpath_eval_expression($context,"//*[name() =
'dt:shadow'][@zygryf='text']");
unset($dom);
unset($context);
unset($results);
}
print microtime() . "\n";
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18457&edit=1