Skip Menu |

This queue is for tickets about the XML-LibXSLT CPAN distribution.

Report information
The Basics
Id: 55623
Status: resolved
Priority: 0/
Queue: XML-LibXSLT

People
Owner: Nobody in particular
Requestors: jozef [...] kutej.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.70
Fixed in: 1.89



Subject: register_function-s are leaking memory when return value is nodelist
Hi Petr, see attached file for an example that is possible to run and that will eat memory. It is enough to replace 'return $nl;' by 'return "";' in the anonymous sub and the memory usage is stable. Regards, Jozef
Subject: register_function-nodelist-mem.pl
#!/usr/bin/perl use strict; use warnings; use XML::LibXML; use XML::LibXSLT; exit main (); sub main { my $xsl_dom = XML::LibXML->load_xml( string => << '__END_XSL__' <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mem="urn:memTest"> <xsl:template match="/"> Nodes are: <xsl:copy-of select="mem:someNodes()"/> </xsl:template> </xsl:stylesheet> __END_XSL__ ); my $xml_dom = XML::LibXML->load_xml( string => << '__END_XML__' <rootElement/> __END_XML__ ); my $xsl = XML::LibXSLT->new->parse_stylesheet($xsl_dom); XML::LibXSLT->register_function( 'urn:memTest', 'someNodes', sub { my $nl = XML::LibXML::NodeList->new; $nl->push(XML::LibXML::Text->new('text')); return $nl; } ); while (1) { $xsl->transform($xml_dom); } exit 0; }
Fixed in 1.89, please close.
On Fri Aug 22 09:12:55 2014, NWELLNHOF wrote: Show quoted text
> Fixed in 1.89, please close.
closing.