Skip Menu |
 

This queue is for tickets about the Devel-Leak-Object CPAN distribution.

Report information
The Basics
Id: 49534
Status: open
Priority: 0/
Queue: Devel-Leak-Object

People
Owner: Nobody in particular
Requestors: vasek.balcar [...] spolecne.cz
Cc:
AdminCc:

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



Subject: looking for super method of the same package in DESTROY for non tracked object
Download (untitled) / with headers
text/plain 1.2k
I believe there is a bug related to the following logic in overridden DESTROY method: ... \$original = \$class; } ... my \$super = \$Devel::Leak::Object::DESTROY_NEXT{\$original}->{'$class'}; unless ( defined \$super ) { die "Failed to find super-method for class \$class in package $class"; } imagine an object which hasn't been tracked, but another object(s) of the same class (which do have the original DESTROY) have been tracked - so the class got the overridden DESTROY. So for non tracked object the call will be made on \$super = \$Devel::Leak::Object::DESTROY_NEXT{\$original}->{'$class'}; which effectively searches for DESTROY_NEXT{$X}->{$X} - and failing later with die "Failed to find super-method for class ... see the following code to demonstrate that. Sorry it is a bit artificial, since here I have to use the explicit DESTROY call. I wasn't able to use my real code where the explicit DESTROY is not called - it would be too complex). I also think the problem is specifically affecting the FileHandle objects, since they are spawned sooner then bless is overridden. #!/usr/bin/perl -w use strict; use Devel::Leak::Object qw(GLOBAL_bless); use FileHandle; $SIG{__DIE__} = sub { print "Report hidden die: ".$_[0]}; my $f = new FileHandle(); $f->DESTROY();
Subject: Re: [rt.cpan.org #49534] looking for super method of the same package in DESTROY for non tracked object
Date: Wed, 9 Sep 2009 14:14:43 +1000
To: bug-Devel-Leak-Object [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
Download (untitled) / with headers
text/plain 1.9k
Would you like commit to try and fix it? Adam K 2009/9/9 Vasek Balcar via RT <bug-Devel-Leak-Object@rt.cpan.org>: Show quoted text
> Tue Sep 08 18:08:02 2009: Request 49534 was acted upon. > Transaction: Ticket created by VASEK >       Queue: Devel-Leak-Object >     Subject: looking for super method of the same package in DESTROY for non >  tracked object >   Broken in: (no value) >    Severity: (no value) >       Owner: Nobody >  Requestors: vasek.balcar@spolecne.cz >      Status: new >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=49534 > > > > I believe there is a bug related to the following logic in overridden DESTROY method: > > ... >       \$original = \$class; >    } > ... >    my \$super = \$Devel::Leak::Object::DESTROY_NEXT{\$original}->{'$class'}; >    unless ( defined \$super ) { >        die "Failed to find super-method for class \$class in package $class"; >    } > > imagine an object which hasn't been tracked, but another object(s) of the same class (which > do have the original DESTROY) have been tracked - so the class got the overridden DESTROY. > > So for non tracked object the call will be made on \$super = > \$Devel::Leak::Object::DESTROY_NEXT{\$original}->{'$class'}; > > which effectively searches for DESTROY_NEXT{$X}->{$X} - and failing later with > >  die "Failed to find super-method for class ... > > see the following code to demonstrate that. Sorry it is a bit artificial, since here I have to use > the explicit DESTROY call. I wasn't able to use my real code where the explicit DESTROY is > not called - it would be too complex). > > I also think the problem is specifically affecting the FileHandle objects, since they are > spawned sooner then bless is overridden. > > #!/usr/bin/perl -w > > use strict; > use Devel::Leak::Object qw(GLOBAL_bless); > use FileHandle; > $SIG{__DIE__} = sub { print "Report hidden die: ".$_[0]}; > > my $f = new FileHandle(); > $f->DESTROY(); > > > >
Subject: Re: [rt.cpan.org #49534] looking for super method of the same package in DESTROY for non tracked object
Date: Wed, 9 Sep 2009 08:24:08 +0200
To: bug-Devel-Leak-Object [...] rt.cpan.org
From: Vasek Balcar <vasek.balcar [...] spolecne.cz>
Download (untitled) / with headers
text/plain 436b
Hi Adam, sure, BTW this is what seemed to help for me: - my \$super = \$Devel::Leak::Object::DESTROY_NEXT{\$original}- Show quoted text
>{'$class'};
+ my \$super = \$original eq '$class' ? '':\ $Devel::Leak::Object::DESTROY_NEXT{\$original}->{'$class'}; -- vasek On 9. Sep, 2009, at 06:15, Reserved Local Account via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=49534 > > > Would you like commit to try and fix it? > > Adam K


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.