Skip Menu |

This queue is for tickets about the Test-Without-Module CPAN distribution.

Report information
The Basics
Id: 91857
Status: resolved
Priority: 0/
Queue: Test-Without-Module

People
Owner: Nobody in particular
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc:
AdminCc:

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



Subject: Test::Without::Module->import leaks memory
‘use Foo’ is generally expected to be idempotent. In Test::Without::Module’s case, it keeps adding the same sub to @INC, creating a memory leak. Watch the memory usage go up: $ perl -MTest::Without::Module -e 'warn $$; while(1){ import Test::Without::Module }'
Patch to fix attached.
Subject: 0001-only-add-INC-hook-once.patch
From ffdb95e2f98227872f7e96719a2f6f6743c90d5d Mon Sep 17 00:00:00 2001 From: Graham Knop <haarg@haarg.org> Date: Wed, 20 Aug 2014 10:37:51 -0400 Subject: [PATCH] only add @INC hook once --- lib/Test/Without/Module.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Test/Without/Module.pm b/lib/Test/Without/Module.pm index e3f240f..ed5de83 100755 --- a/lib/Test/Without/Module.pm +++ b/lib/Test/Without/Module.pm @@ -26,7 +26,7 @@ sub import { scrub( $module ); }; - unshift @INC, \&fake_module; + @INC = (\&fake_module, grep { !ref || $_ != \&fake_module } @INC); }; sub fake_module { -- 2.0.4
Max, do you think you'll make a release of this? If you're not disposed to do it right now, I can take care of this and the other recent ticket. -- rjbs
Subject: Re: [rt.cpan.org #91857] Test::Without::Module->import leaks memory
Date: Thu, 21 Aug 2014 07:45:02 +0300
To: bug-Test-Without-Module [...] rt.cpan.org
From: Max Maischein <webmaster [...] corion.net>
Hello Ricardo, I'm at YAPC::Europe right now, so I can't promise a release until I get back home. If this is urgent, ypu're welcome to do a release! -max On 21. August 2014 05:31:39 OESZ, Ricardo Signes via RT <bug-Test-Without-Module@rt.cpan.org> wrote: Show quoted text
> Queue: Test-Without-Module > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=91857 > > >Max, do you think you'll make a release of this? If you're not >disposed to do it right now, I can take care of this and the other >recent ticket. > >-- >rjbs
-- Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
Thanks for the report! Your fix is on its way to CPAN with 0.18.