cubranic / Statistics-R-IO

Pure Perl implementation for reading native data files produced by R statistical computing environment
2 stars 1 forks source link

Check for leaks #50

Open cubranic opened 9 years ago

cubranic commented 9 years ago

Could use Devel::Leak or Test::LeakTrace.

A gist I found suggests Devel::LeakTrace::Fast as a better alternative for Devel::Leak and Devel::LeakTrace. But installing Devel::LeakTrace::Fast on a recent Perl required fixing several bugs: the patches are all on RT, but have been ignored for 2 years or more.

cubranic commented 8 years ago

Devel::LeakTrace::Fast report on $ perl -Ilib -MStatistics::R::IO::Rserve -MTest::LeakTrace -e '{my $rserve = Statistics::R::IO::Rserve->new; $rserve->eval("pi"); $rserve->close }'

leaked GV(0x0x7fa25cf61598) from reader Statistics::R::IO::Rserve::fh (defined at lib/Statistics/R/IO/Rserve.pm line 46) line 12
leaked GV(0x0x7fa25cf52750) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket.pm line 209
leaked SV(0x0x7fa25cf527e0) from lib/Statistics/R/IO/Parser.pm line 426
leaked SV(0x0x7fa25c029f30) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket/INET.pm line 91
leaked GV(0x0x7fa25c029d50) from lib/Statistics/R/IO/Rserve.pm line 38
leaked SV(0x0x7fa25c029d98) from lib/Statistics/R/IO/Parser.pm line 30
leaked HV(0x0x7fa25c10b028) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket.pm line 159
leaked HV(0x0x7fa25c029de0) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket/INET.pm line 37
leaked GV(0x0x7fa25c5af5c0) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Try/Tiny.pm line 61
leaked SV(0x0x7fa25cf52228) from lib/Statistics/R/IO/Parser.pm line 426
leaked SV(0x0x7fa25c881470) from lib/Statistics/R/IO/Parser.pm line 112
leaked SV(0x0x7fa25c029ea0) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/Symbol.pm line 131
leaked AV(0x0x7fa25cf60f50) from lib/Statistics/R/IO/Parser.pm line 355
leaked SV(0x0x7fa25c2e3f38) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket.pm line 86
leaked SV(0x0x7fa25cf615c8) from reader Statistics::R::IO::Rserve::fh (defined at lib/Statistics/R/IO/Rserve.pm line 46) line 12
leaked SV(0x0x7fa25cf090a8) from lib/Statistics/R/IO/Parser.pm line 426
leaked RV(0x0x7fa25cf527c8) from lib/Statistics/R/IO/QapEncoding.pm line 309
leaked GV(0x0x7fa25c029d80) from reader Statistics::R::IO::Rserve::fh (defined at lib/Statistics/R/IO/Rserve.pm line 46) line 12
leaked GV(0x0x7fa25c029dc8) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket.pm line 43
leaked SV(0x0x7fa25caf9078) from lib/Statistics/R/IO/QapEncoding.pm line 206
leaked GV(0x0x7fa25cebfea0) from reader Statistics::R::IO::Rserve::fh (defined at lib/Statistics/R/IO/Rserve.pm line 46) line 7
leaked SV(0x0x7fa25cf61460) from lib/Statistics/R/IO/Parser.pm line 300
leaked SV(0x0x7fa25c848e78) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket.pm line 84
leaked AV(0x0x7fa25cf51c70) from lib/Statistics/R/IO/Parser.pm line 319
leaked GV(0x0x7fa25c029e88) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/Symbol.pm line 104
leaked SV(0x0x7fa25c02a4b8) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/Symbol.pm line 131
leaked SV(0x0x7fa25cf611f0) from lib/Statistics/R/IO/Parser.pm line 300
leaked SV(0x0x7fa25c7ca248) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket.pm line 47
leaked HV(0x0x7fa25c029db0) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket.pm line 43
leaked SV(0x0x7fa25caf90a8) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Try/Tiny.pm line 124
leaked GV(0x0x7fa25c029df8) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket/INET.pm line 37
leaked SV(0x0x7fa25c029e70) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/Symbol.pm line 102
leaked SV(0x0x7fa25c029c90) from constructor Statistics::R::IO::Rserve::new (defined at lib/Statistics/R/IO/Rserve.pm line 357) line 42
leaked GV(0x0x7fa25c87e3e8) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket/INET.pm line 257
leaked SV(0x0x7fa25c029eb8) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket.pm line 47
leaked SV(0x0x7fa25cb2e890) from lib/Statistics/R/IO/Parser.pm line 363
leaked RV(0x0x7fa25c2e5338) from lib/Statistics/R/IO/QapEncoding.pm line 646
leaked SV(0x0x7fa25cf61370) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket.pm line 208
leaked SV(0x0x7fa25c2e33c8) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket.pm line 85
leaked GV(0x0x7fa25c02a4e8) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket/INET.pm line 180
cubranic commented 8 years ago

Test::LeakTrace report on $ $ perl -Ilib -MStatistics::R::IO::Rserve -MTest::LeakTrace -e 'leaktrace {my $r = Statistics::R::IO::Rserve->new; $r->eval("pi"); $r->close }':

leaked GLOB(0x7fca7902a500) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket.pm line 45.
leaked HASH(0x7fca79029f30) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket.pm line 43.
leaked GLOB(0x7fca79029f18) from lib/Statistics/R/IO/Rserve.pm line 306.
leaked SCALAR(0x7fca79029eb8) from lib/Statistics/R/IO/Parser.pm line 30.
leaked GLOB(0x7fca79029ea0) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket.pm line 43.
leaked GLOB(0x7fca79029e88) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket/INET.pm line 37.
leaked HASH(0x7fca79029e70) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket/INET.pm line 37.
leaked SCALAR(0x7fca79029de0) from constructor Statistics::R::IO::Rserve::new (defined at lib/Statistics/R/IO/Rserve.pm line 357) line 42.
leaked GLOB(0x7fca79029dc8) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket/INET.pm line 257.
leaked GLOB(0x7fca79029d98) from lib/Statistics/R/IO/Rserve.pm line 38.
leaked GLOB(0x7fca79029d50) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/darwin-2level/Test/LeakTrace.pm line 46.
leaked GLOB(0x7fca79a83730) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket/INET.pm line 180.
leaked SCALAR(0x7fca79a856e8) from lib/Statistics/R/IO/Parser.pm line 28.
leaked SCALAR(0x7fca79bcb670) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket/INET.pm line 91.
leaked GLOB(0x7fca79c296a0) from reader Statistics::R::IO::Rserve::fh (defined at lib/Statistics/R/IO/Rserve.pm line 46) line 7.
leaked GLOB(0x7fca7b8d7f98) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Try/Tiny.pm line 61.
leaked GLOB(0x7fca79cbf3c0) from lib/Statistics/R/IO/Rserve.pm line 347.
leaked SCALAR(0x7fca79cbf2a0) from lib/Statistics/R/IO/QapEncoding.pm line 309.
leaked GLOB(0x7fca79cbf198) from /Users/davor/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level/IO/Socket.pm line 209.