View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014551CDashCMakepublic2013-11-07 17:542013-11-08 03:32
ReporterPedro Navarro 
Assigned ToJulien Jomier 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version2.2 
Summary0014551: [PATCH] CDash gives out of memory errors when attempting to XSLT transform large XML files
DescriptionSome our generated XML files can be quite large and they can have text nodes that exceed the built-in libXML limit (by default 10 Mb). That happens a lot on Dynamic Analysis files or large test output logs.

According to PHP's documentation (http://us1.php.net/manual/en/libxml.constants.php [^]) the LIBXML_PARSEHUGE flag can be passed to loadXML so it sets libxml's XML_PARSE_HUGE_FLAG, which "relaxes any hardcoded limit from the parser. This affects limits like maximum depth of a document or the entity recursion, as well as limits of the size of text nodes." According to the documentation, "the flag is only available in Libxml >= 2.7.0 (as of PHP >= 5.3.2 and PHP >= 5.2.12)"

The patch checks if LIBXML_VERSION is >= 20700 and, if it is, passes LIBXML_PARSEHUGE when calling loadXML:

$xml->loadXML($args[$xml_arg], LIBXML_PARSEHUGE);
$xsl->loadXML(file_get_contents($xsl_arg), LIBXML_PARSEHUGE);
TagsNo tags attached.
Attached Filespatch file icon 0001-Use-the-LIBXML_PARSEHUGE-flag-when-loading-XML-files.patch [^] (1,023 bytes) 2013-11-07 17:54 [Show Content]

 Relationships

  Notes
(0034421)
Julien Jomier (manager)
2013-11-08 03:32

I had to add a check on the PHP version since this doesn't seem to work with my php 5.3.1.

 Issue History
Date Modified Username Field Change
2013-11-07 17:54 Pedro Navarro New Issue
2013-11-07 17:54 Pedro Navarro File Added: 0001-Use-the-LIBXML_PARSEHUGE-flag-when-loading-XML-files.patch
2013-11-08 03:14 Julien Jomier Assigned To => Julien Jomier
2013-11-08 03:14 Julien Jomier Status new => assigned
2013-11-08 03:32 Julien Jomier Note Added: 0034421
2013-11-08 03:32 Julien Jomier Status assigned => resolved
2013-11-08 03:32 Julien Jomier Fixed in Version => 2.2
2013-11-08 03:32 Julien Jomier Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team