Bug #18376 Updated: After an abitrary number of nodes DOMXML dies on large XML documents
| From: | watford at uiuc dot edu | Date: | Wed, 17 Jul 2002 17:59:47 +0000 |
| Subject: | Bug #18376 Updated: After an abitrary number of nodes DOMXML dies on large XML documents | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-14433@lists.php.net to get a copy of this message | ||
ID: 18376
Updated by: watford@uiuc.edu
Reported By: watford@uiuc.edu
Status: Closed
Bug Type: DOM XML related
Operating System: Windows 2000 Pro
PHP Version: 4.2.1
New Comment:
After installing the latest stable release from snaps I get this error
when starting Apache2:
C:\Program Files\Apache Group\Apache2\bin>apache.exe -f
..\conf\httpd.conf -d ..
\.
apache.exe: module
"c:\php4build\snap\sapi\apache2filter\sapi_apache2.c" is not
compatible with this version of Apache.
Please contact the vendor for the correct version.
I'm trying to test the newest version to see if it corrected the
problem, but everything I've tried has failed to work :/
Previous Comments:
------------------------------------------------------------------------
[2002-07-16 17:28:37] chregu@php.net
Instead of the latest devel snapshot you can also try the latest
_stable_ snapshot (which will become 4.2.2 in the hopefully not so
distant future). It is fixed there as well.
Please reopen it, if the problem still persist.
chregu
------------------------------------------------------------------------
[2002-07-16 16:15:12] jtate@php.net
Can you try this with the current CVS snapshot available from
http://snaps.php.net.
------------------------------------------------------------------------
[2002-07-16 16:05:41] watford@uiuc.edu
I got ahold of the register values at that point, but I can't get the
contents of memory:
EAX = 150082D0 EBX = 0060E6C0 ECX = 00000000 EDX = 14C0FAE4
ESI = 14C0FAB0 EDI = 0060E6C0 EIP = 006A6397 ESP = 14C0FAA0
EBP = 14C0FBB4 EFL = 00000202 CS = 001B DS = 0023 ES = 0023 SS = 0023
FS = 0038 GS = 0000 OV=0 UP=0 EI=1 PL=0 ZR=0 AC=0 PE=0 CY=0
150082DA = ????
ST0 = +0.00000000000000000e+0000 ST1 = +9.19248417784877260e+4083
ST2 = +0.00000000000000000e+0000 ST3 = +0.00000000000000000e+0000
ST4 = +0.00000000000000000e+0000 ST5 = +0.00000000000000000e+0000
ST6 = -6.14161125457030721e+0005 ST7 = 1#QNAN
CTRL = 027F STAT = 4020 TAGS = FFFF EIP = 00C8D934 CS = 001B DS =
0023
EDO = 00CD1AC8
------------------------------------------------------------------------
[2002-07-16 16:03:31] watford@uiuc.edu
As another note it dies AFTER it sends the data to the browser, and
after it outputs the data to STDOUT [if run via php.exe].
------------------------------------------------------------------------
[2002-07-16 16:02:08] watford@uiuc.edu
When I run my script that parses a DOMXML Object into smaller more
managable objects, it will die on long XML documents [40+ elements]
with the error: Unhanded exception in Apache.exe (PHP4TS.DLL):
0xC0000005: Access Violation. The Apache version is 2.0.36, and I have
yet to try this with the 1.3.X branch of Apache. Here is the output
from PHP4TS.DLL where it died:
006A6391 mov esi,dword ptr [esp+8]
006A6395 mov eax,dword ptr [esi]
-> 006A6397 dec word ptr [eax+0Ah]
006A639B mov eax,dword ptr [esi]
006A639D mov cx,word ptr [eax+0Ah]
006A63A1 test cx,cx
Here is my PHP Script:
<?php
class xmlNodeProperties
{
function xmlNodeProperties(/*void*/)
{ }
/*String*/ function getAttribute(/*String*/ $key)
{ return $this->$key; }
/*void*/ function setAttribute(/*String*/ $key, /*String*/ $val)
{ $this->$key = $val; }
}
class xmlNode extends xmlNodeProperties
{
var /*String*/ $nodeName;
var /*String*/ $cdata;
var /*xmlNode[]*/ $childNodes;
function xmlNode(/*void*/)
{
$this->xmlNodeProperties();
}
}
class CXMLParser
{
var /*xmlNode*/ $root;
function CXMLParser(/*void*/)
{
if(!$this->use_file) {
/*domxmlTree*/ $t = xmltree($this->xml_str);
$this->xml_str = "";
} else {
/*domxmlTree*/ $t =
xmltree(domxml_dump_mem(xmldocfile($this->file)));
}
$this->root = new xmlNode();
$this->root->cdata = $this->get_cdata($t->children[0]);
$this->root->nodeName = $t->children[0]->tagname;
foreach($t->children[0]->attributes as /*domxmlNode*/ $a)
{
$this->root->setAttribute($a->name, $a->value);
}
foreach($t->children[0]->children as /*domxmlNode*/ $c)
{
/*xmlNode*/ $n = $this->parse($c);
if($n === false) { }
else {
$this->root->childNodes[] = $n;
}
}
}
/*xmlNode*/ function parse(/*domxmlNode*/ $domnode)
{
if($domnode->type != 1) return false;
/*xmlNode*/ $node = new xmlNode();
$node->cdata = $this->get_cdata($domnode);
$node->nodeName = $domnode->tagname;
foreach($domnode->attributes as /*domxmlNode*/ $a)
{
$node->setAttribute($a->name, $a->value);
}
foreach($domnode->children as /*domxmlNode*/ $c)
{
/*xmlNode*/ $n = $this->parse($c);
if($n === false) { }
else {
$node->childNodes[] = $n;
}
}
return $node;
}
/*String*/ function get_cdata(/*domxmlNode*/ $node)
{
foreach($node->children as /*domxmlNode*/ $c)
{
if($c->type == 3)
{
return $c->content;
}
}
return "";
}
}
class CXMLDocument extends CXMLParser
{
var /*String*/ $file;
var /*String*/ $xml_str;
var /*int*/ $use_file;
function CXMLDocument(/*...*/)
{
/*Array*/ $arglist = func_get_args();
if( !count($arglist) ) {
$this->xml_str = "";
$this->file = "";
$this->use_file = 0;
} else if( count($arglist) < 2 ) {
$this->xml_str = $arglist[0];
$this->file = "";
$this->use_file = 0;
} else {
$this->file = $arglist[0];
$this->use_file = $arglist[1];
if(file_exists($this->file)) {
/*domxmlDocument*/ $d = domxml_open_file($this->file);
if($d === false) { die("bad xml file"); }
} else {
die("bad file name or file does not exist");
}
}
$this->CXMLParser();
}
}
$xmlDoc = new CXMLDocument('
<columns>
<date name="Adv_Plan">Advanced Planning Meeting</date>
<date name="Rec_Pre_EUP">Receive Preliminary EUP</date>
<date name="Start_Prel_FC">Start Preliminary Fuel Cycle</date>
<date name="Send_Prel_FC">Send Preliminary Fuel Cycle</date>
<date name="Rec_Rel_EUP">Receive Release EUP</date>
<date name="Start_Rel_FC">Start Release Fuel Cycle</date>
<date name="Send_Rel_FC" important="1">Send Release Fuel
Cycle</date>
<date name="Send_Start_Rep" important="1">Send Startup
Report</date>
<date name="Final_eWA">Final eWA</date>
<date name="LicKickoff">Licensing Kickoff Meeting</date>
<date name="Mini_Review">Mini Review</date>
<date name="Send_Dft_FRED">Send Draft FRED</date>
<date name="Send_Dft_OPL">Send Draft OPL</date>
<date name="Rec_FRED">Receive Customer FRED</date>
<date name="SEND_OPL" allcaps="1">Send Customer OPL3</date>
<date name="Rec_OPL">Receive Customer OPL3</date>
<date name="SEND_FRED" allcaps="1">Send Customer FRED</date>
<date name="Download">Download to Manufacturing</date>
<date name="RLP">RLP</date>
<date name="SR1" important="1">SLMCPR</date>
<date name="Send_Drf_SRLR">Send Draft SRLR</date>
<date name="Rec_Comments_SRLR">Recieve Comments on SRLR</date>
<date name="Send_Final_SRLR" important="1">Send Final SRLR</date>
<date name="SEND_PREL_PCDB" allcaps="1">Send Preliminary
PCDB</date>
<date name="PCDB" important="1">Send Final PCDB</date>
<date name="CMR" important="1">Send CMR</date>
<date name="SEND_CMR1" allcaps="1">Send CMR Revision 1</date>
<date name="SEND_CMR2" allcaps="1">Send CMR Revision 2</date>
<date name="Rec_Cus_EOC">Receive Customer EOC Data</date>
<date name="SR2">Special Requirements 1</date>
<date name="SR3">Special Requirements 2</date>
<date name="SR4">Special Requirements 3</date>
<date name="SR5">Special Requirements 4</date>
<date name="Eigen_Rev">Eigenvalue Review</date>
<date name="FSDD">FSDD</date>
<date name="Loca_TSD">LOCA TSD</date>
<date name="Loca_Data">LOCA Interface Data</date>
<date name="Loca_Start">Start LOCA Analysis</date>
<date name="Loca_Fin">Complete LOCA Analysis</date>
<date name="Stab_TSD">Stability TSD</date>
<date name="Stab_Data">Stability Interface Data</date>
<date name="Stab_Start">Start Stability Analysis</date>
<date name="Stab_Fin">Complete Stability Analysis</date>
<date name="Trans_TSD">Transient TSD</date>
<date name="TRANS_DATA" allcaps="1">Transient Interface Data</date>
<date name="Trans_Sel_Rev">Transient Selection Review</date>
<date name="Trans_Start">Start Transient Analysis</date>
<date name="Trans_Fin">Complete Transient Analysis</date>
<date name="TRANS_WRAPUP" allcaps="1">Transient Wrapups</date>
<date name="BNDL_REP" allcaps="1">Bundle Announcement Report</date>
<date name="CMIT" allcaps="1">CMIT</date>
<date name="SEND_OPL7" allcaps="1">Send OPL7</date>
<date name="REC_OPL7" allcaps="1">Recieve Customer OPL7</date>
<date name="RES_OPL7" allcaps="1">Resolved OPL7</date>
<date name="SEND_OPL4" allcaps="1">Send Customer OPL4</date>
<date name="REC_OPL4" allcaps="1">Receive Customer OPL4</date>
</columns>');
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18376&edit=1