MantisBT - CDash
View Issue Details
0014551CDashCMakepublic2013-11-07 17:542013-11-08 03:32
Pedro Navarro 
Julien Jomier 
normalmajoralways
resolvedfixed 
 
2.2 
0014551: [PATCH] CDash gives out of memory errors when attempting to XSLT transform large XML files
Some 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);
No tags attached.
patch 0001-Use-the-LIBXML_PARSEHUGE-flag-when-loading-XML-files.patch (1,023) 2013-11-07 17:54
https://public.kitware.com/Bug/file/4941/0001-Use-the-LIBXML_PARSEHUGE-flag-when-loading-XML-files.patch
Issue History
2013-11-07 17:54Pedro NavarroNew Issue
2013-11-07 17:54Pedro NavarroFile Added: 0001-Use-the-LIBXML_PARSEHUGE-flag-when-loading-XML-files.patch
2013-11-08 03:14Julien JomierAssigned To => Julien Jomier
2013-11-08 03:14Julien JomierStatusnew => assigned
2013-11-08 03:32Julien JomierNote Added: 0034421
2013-11-08 03:32Julien JomierStatusassigned => resolved
2013-11-08 03:32Julien JomierFixed in Version => 2.2
2013-11-08 03:32Julien JomierResolutionopen => fixed

Notes
(0034421)
Julien Jomier   
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.