Skip Menu |

This queue is for tickets about the Config-Any CPAN distribution.

Report information
The Basics
Id: 44525
Status: rejected
Priority: 0/
Queue: Config-Any

People
Owner: Nobody in particular
Requestors: christian.kuelker [...] cipworx.org
Cc:
AdminCc:

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



When tested with Test::LeakTrace it spits out several places of memory leaks, like # 271: # filter out things that don't look like our plugins # 272: return grep { $_->isa( 'Config::Any::Base' ) } $class->finder->plugins; # 273:} It can be reproduced with this script: use lib "."; use TestConfigAnyLeak; use Test::More tests => 1; use Test::LeakTrace; no_leaks_ok { my $t = TestConfigAnyLeak->new(); } 'no memory leaks'; This is the corresponding module: package TestConfigAnyLeak; use Class::Std; use Config::Any; { sub BUILD { my $cfg_hr = Config::Any->load_files( { files => [qw(test.ini)], use_ext => 1, override => 1, flatten_to_hash => 1 } ); retrun; } } 1;
I've tweaked the test file -- but I don't particularly understand the output it returns (see attached). So, I'm marking this as stalled for now.
use strict; use warnings; use Test::More; use Config::Any; eval { require Test::LeakTrace; }; if( $@ ) { plan skip_all => 'Test::LeakTrace required for this test'; } else { plan tests => 2; } Test::LeakTrace::no_leaks_ok( sub { bless {}, 'MyConfig'; } ); Test::LeakTrace::no_leaks_ok( sub { MyConfig->new; } ); package MyConfig; use Config::Any; sub new { my $class = shift; my $conf = Config::Any->load_files( { files => [ qw( t/conf/conf.pl ) ], use_ext => 1, flatten_to_hash => 1 } ); return bless $conf, $class; } 1; __END__ t/leaks.t .. 1..2 ok 1 - leaks 0 == 0 not ok 2 - leaks 8 == 0 # Failed test 'leaks 8 == 0' # at t/leaks.t line 17. # got: 8 # expected: 0 # leaked SCALAR(0x953a1a8) from /usr/local/lib/perl/5.10.0/XSLoader.pm line 94. # 93: push(@DynaLoader::dl_shared_objects, $file); # record files loaded # 94: return &$xs(@_); # 95: # SV = IV(0x953a1a4) at 0x953a1a8 # REFCNT = 1 # FLAGS = (IOK,pIOK) # IV = 156474536 # leaked SCALAR(0x93e7800) from /usr/local/lib/perl/5.10.0/XSLoader.pm line 94. # 93: push(@DynaLoader::dl_shared_objects, $file); # record files loaded # 94: return &$xs(@_); # 95: # SV = IV(0x93e77fc) at 0x93e7800 # REFCNT = 1 # FLAGS = (IOK,pIOK) # IV = 156474216 # leaked SCALAR(0x93e74c0) from /usr/local/lib/perl/5.10.0/XSLoader.pm line 94. # 93: push(@DynaLoader::dl_shared_objects, $file); # record files loaded # 94: return &$xs(@_); # 95: # SV = IV(0x93e74bc) at 0x93e74c0 # REFCNT = 1 # FLAGS = (IOK,pIOK) # IV = 156069040 # leaked SCALAR(0x93e74a0) from /usr/local/lib/perl/5.10.0/XSLoader.pm line 94. # 93: push(@DynaLoader::dl_shared_objects, $file); # record files loaded # 94: return &$xs(@_); # 95: # SV = IV(0x93e749c) at 0x93e74a0 # REFCNT = 1 # FLAGS = (IOK,pIOK) # IV = 156452128 # leaked SCALAR(0x93e7420) from /usr/local/lib/perl/5.10.0/XSLoader.pm line 94. # 93: push(@DynaLoader::dl_shared_objects, $file); # record files loaded # 94: return &$xs(@_); # 95: # SV = IV(0x93e741c) at 0x93e7420 # REFCNT = 1 # FLAGS = (IOK,pIOK) # IV = 156453408 # leaked SCALAR(0x93e7380) from /usr/local/lib/perl/5.10.0/XSLoader.pm line 94. # 93: push(@DynaLoader::dl_shared_objects, $file); # record files loaded # 94: return &$xs(@_); # 95: # SV = IV(0x93e737c) at 0x93e7380 # REFCNT = 1 # FLAGS = (IOK,pIOK) # IV = 155419272 # leaked SCALAR(0x9553b90) from /usr/local/lib/perl/5.10.0/XSLoader.pm line 94. # 93: push(@DynaLoader::dl_shared_objects, $file); # record files loaded # 94: return &$xs(@_); # 95: # SV = IV(0x9553b8c) at 0x9553b90 # REFCNT = 1 # FLAGS = (IOK,pIOK) # IV = 156206264 # leaked SCALAR(0x9553a20) from /usr/local/lib/perl/5.10.0/XSLoader.pm line 94. # 93: push(@DynaLoader::dl_shared_objects, $file); # record files loaded # 94: return &$xs(@_); # 95: # SV = IV(0x9553a1c) at 0x9553a20 # REFCNT = 1 # FLAGS = (IOK,pIOK) # IV = 155084944 # Looks like you failed 1 test of 2. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/2 subtests Test Summary Report ------------------- t/leaks.t (Wstat: 256 Tests: 2 Failed: 1) Failed test: 2 Non-zero exit status: 1 Files=1, Tests=2, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.07 cusr 0.01 csys = 0.10 CPU) Result: FAIL
This seems to be a false-positive from Test::LeakTrace. I've submitted the following bug report: http://rt.cpan.org/Public/Bug/Display.html?id=58133