Skip Menu |

This queue is for tickets about the TryCatch CPAN distribution.

Report information
The Basics
Id: 82618
Status: open
Priority: 0/
Queue: TryCatch

People
Owner: Nobody in particular
Requestors: b3nm0nty [...] gmail.com
Cc: SREZIC [...] cpan.org
AdminCc:

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



Subject: TryCatch leaks memory when used with MooseX::Declare
Distribution: TryCatch Version: 1.003000 Perl: 5, version 14, subversion 2 (v5.14.2) built for i686-linux-gnu- thread-multi-64int uname -a: Linux pineapple 3.2.0-35-generic-pae #55-Ubuntu SMP Wed Dec 5 18:04:39 UTC 2012 i686 i686 i386 GNU/Linux Description: The try block created by the distribution TryCatch traps references when used in combination with MooseX::Declare.
Subject: try_catch_test.pl
use strict; use warnings; use Devel::Refcount qw/refcount/; use MooseX::Declare; class FooEval { method bar () { eval { $self->baz; }; } method baz () { return 2 + 2; } }; class FooTryTiny { use Try::Tiny; method bar () { try { $self->baz; } catch { }; } method baz () { return 2 + 2; } }; class FooTryCatch { use TryCatch; method bar () { try { $self->baz; } catch ($err) { }; } method baz () { return 2 + 2; } }; my @classes = qw/FooTryCatch FooTryTiny FooEval/; foreach (@classes) { my $foo = $_->new; print "devel refcount pre-$_: " . refcount($foo) . "\n"; for (1 .. 5) { $foo->bar; } print "devel refcount post-$_: " . refcount($foo) . "\n\n"; } #devel refcount pre-FooTryCatch: 1 #devel refcount post-FooTryCatch: 6 # #devel refcount pre-FooTryTiny: 1 #devel refcount post-FooTryTiny: 1 # #devel refcount pre-FooEval: 1 #devel refcount post-FooEval: 1
On Thu Jan 10 11:15:31 2013, https://www.google.com/accounts/o8/id? id=AItOawnhaEJwRSda5kQS8I7dvg0Qq9Hok5J7Aqg wrote: Show quoted text
> Distribution: TryCatch > Version: 1.003000 > Perl: 5, version 14, subversion 2 (v5.14.2) built for i686-linux-gnu- > thread-multi-64int > uname -a: Linux pineapple 3.2.0-35-generic-pae #55-Ubuntu SMP Wed Dec 5 > 18:04:39 UTC 2012 i686 i686 i386 GNU/Linux > > Description: The try block created by the distribution TryCatch traps > references when used in combination with MooseX::Declare.
Subject: try_catch_test.txt
use strict; use warnings; use Devel::Refcount qw/refcount/; use MooseX::Declare; class FooEval { method bar () { eval { $self->baz; }; } method baz () { return 2 + 2; } }; class FooTryTiny { use Try::Tiny; method bar () { try { $self->baz; } catch { }; } method baz () { return 2 + 2; } }; class FooTryCatch { use TryCatch; method bar () { try { $self->baz; } catch ($err) { }; } method baz () { return 2 + 2; } }; my @classes = qw/FooTryCatch FooTryTiny FooEval/; foreach (@classes) { my $foo = $_->new; print "devel refcount pre-$_: " . refcount($foo) . "\n"; for (1 .. 5) { $foo->bar; } print "devel refcount post-$_: " . refcount($foo) . "\n\n"; } #devel refcount pre-FooTryCatch: 1 #devel refcount post-FooTryCatch: 6 # #devel refcount pre-FooTryTiny: 1 #devel refcount post-FooTryTiny: 1 # #devel refcount pre-FooEval: 1 #devel refcount post-FooEval: 1
On 2013-01-10 11:15:31, https://www.google.com/accounts/o8/id?id=AItOawnhaEJwRSda5kQS8I7dvg0Qq9Hok5J7Aqg wrote: Show quoted text
> Distribution: TryCatch > Version: 1.003000 > Perl: 5, version 14, subversion 2 (v5.14.2) built for i686-linux-gnu- > thread-multi-64int > uname -a: Linux pineapple 3.2.0-35-generic-pae #55-Ubuntu SMP Wed Dec 5 > 18:04:39 UTC 2012 i686 i686 i386 GNU/Linux > > Description: The try block created by the distribution TryCatch traps > references when used in combination with MooseX::Declare.
I also see this problem with the following configurations: * perl 5.12.3 TryCatch 1.003002 MooseX::Declare 0.37 * perl 5.18.2 TryCatch 1.003002 MooseX::Declare 0.39