Skip Menu |
 

This queue is for tickets about the Text-Template CPAN distribution.

Report information
The Basics
Id: 22031
Status: open
Priority: 0/
Queue: Text-Template

People
Owner: Nobody in particular
Requestors: radu [...] yx.ro
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: _scrubpkg still leaks memory
Date: Wed, 11 Oct 2006 18:08:20 +0300
To: bug-Text-Template [...] rt.cpan.org
From: Radu Greab <radu [...] yx.ro>
Download (untitled) / with headers
text/plain 1.2k
In Text::Template 0.44 _scrubpkg is still causing memory leaks in long running processes. The generated package is not cleared and the package is not removed from the symbol table of Text::Template. The change below has fixed this problem for me. diff -Naur Text-Template-1.44.orig/lib/Text/Template.pm Text-Template-1.44/lib/Text/Template.pm --- Text-Template-1.44.orig/lib/Text/Template.pm 2003-04-29 23:24:30.000000000 +0300 +++ Text-Template-1.44/lib/Text/Template.pm 2006-07-01 05:03:54.000000000 +0300 @@ -428,6 +428,8 @@ foreach my $key (keys %$hash) { undef $hash->{$key}; } + %$hash = (); + delete $Text::Template::{$s."::"}; } } diff -Naur Text-Template-1.44.orig/t/01-basic.t Text-Template-1.44/t/01-basic.t --- Text-Template-1.44.orig/t/01-basic.t 2003-04-29 23:13:10.000000000 +0300 +++ Text-Template-1.44/t/01-basic.t 2006-07-01 05:04:24.000000000 +0300 @@ -245,7 +245,9 @@ # (31) Test _scrubpkg for leakiness $Text::Template::GEN0::test = 1; Text::Template::_scrubpkg('Text::Template::GEN0'); -if ($Text::Template::GEN0::test) { +if ($Text::Template::GEN0::test + || exists $Text::Template::GEN0::{test} + || exists $Text::Template::{'GEN0::'}) { print "not ok $n\n"; } else { print "ok $n\n";
Download (untitled) / with headers
text/plain 1.4k
this is fixed in debian http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=609528 On Wed Oct 11 11:08:38 2006, radu@yx.ro wrote: Show quoted text
> > In Text::Template 0.44 _scrubpkg is still causing memory leaks in long > running processes. The generated package is not cleared and the > package > is not removed from the symbol table of Text::Template. > > The change below has fixed this problem for me. > > > diff -Naur Text-Template-1.44.orig/lib/Text/Template.pm Text-Template- > 1.44/lib/Text/Template.pm > --- Text-Template-1.44.orig/lib/Text/Template.pm 2003-04-29 > 23:24:30.000000000 +0300 > +++ Text-Template-1.44/lib/Text/Template.pm 2006-07-01 > 05:03:54.000000000 +0300 > @@ -428,6 +428,8 @@ > foreach my $key (keys %$hash) { > undef $hash->{$key}; > } > + %$hash = (); > + delete $Text::Template::{$s."::"}; > } > } > > diff -Naur Text-Template-1.44.orig/t/01-basic.t Text-Template- > 1.44/t/01-basic.t > --- Text-Template-1.44.orig/t/01-basic.t 2003-04-29 23:13:10.000000000 > +0300 > +++ Text-Template-1.44/t/01-basic.t 2006-07-01 05:04:24.000000000 > +0300 > @@ -245,7 +245,9 @@ > # (31) Test _scrubpkg for leakiness > $Text::Template::GEN0::test = 1; > Text::Template::_scrubpkg('Text::Template::GEN0'); > -if ($Text::Template::GEN0::test) { > +if ($Text::Template::GEN0::test > + || exists $Text::Template::GEN0::{test} > + || exists $Text::Template::{'GEN0::'}) { > print "not ok $n\n"; > } else { > print "ok $n\n";
Download (untitled) / with headers
text/plain 110b
Still broken in 1.45... Patched submitted for FreeBSD... http://www.freebsd.org/cgi/query-pr.cgi?pr=166198


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.