Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: asjo [...] koldfront.dk
Cc:
AdminCc:

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



Subject: DESTROY not always called
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Charset: utf8
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1223477082-27688-16"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 2409
Download (untitled) / with headers
text/plain 2.3k
I am not sure this is a bug, but it seems to me like DESTROY isn't always called the same number of times when Devel::Leak::Object (GLOBAL_bless) is activated compared to when it isn't. I'm not sure that it ought to, but I think so? I have created a little test-program (attached) that shows this. When I run it, I get this output when D:L:O is commented out: car Car=HASH(0x6ecdd0) * DESTROY Car=HASH(0x6ecdd0) producer Producer=HASH(0x6ecdd0) car Car=HASH(0x6ece20) * DESTROY Car=HASH(0x6ece20) * DESTROY Producer=HASH(0x6ecdd0) car Car=HASH(0x6ece30) * DESTROY Car=HASH(0x6ece30) which makes sense to me, I create a car and it is DESTROYed as it goes out of scope, then a producer and a car, also DESTROYed, and finally another car; DESTROYed. If I comment in Devel::Leak::Object qw{ GLOBAL_bless }, I get this output: Devel::Leak::Object version: 0.92 car Car=HASH(0x736610) * DESTROY Car=HASH(0x736610) producer Producer=HASH(0x736610) car Car=HASH(0x7461c0) * DESTROY Producer=HASH(0x736610) car Car=HASH(0x746140) Tracked objects by class: Now, after I have created a producer, no cars are DESTROYed anymore! I think it has to do with how Devel::Leak::Object::DESTROY_NEXT is populated and interpreted, because if I add a warn line like this: --- Object.pm.orig 2008-10-08 11:36:59.000000000 +0200 +++ Object.pm 2008-10-08 16:35:14.000000000 +0200 @@ -119,6 +119,7 @@ } my \$super = \$Devel::Leak::Object::DESTROY_NEXT{\$original}->{'$class'}; unless ( defined \$super ) { + warn "Failed to find super-method for class \$class in package $class"; die "Failed to find super-method for class \$class in package $class"; } if ( \$super ) { I get this output: Devel::Leak::Object version: 0.92 car Car=HASH(0x736590) * DESTROY Car=HASH(0x736590) producer Producer=HASH(0x736590) car Car=HASH(0x745980) Failed to find super-method for class Car in package Producer at (eval 5) line 46. * DESTROY Producer=HASH(0x736590) car Car=HASH(0x745900) Failed to find super-method for class Car in package Producer at (eval 5) line 46. Tracked objects by class: I haven't really understood how the DESTROY_NEXT structure is supposed to work, so I may very well be mistaken. If this is a bug, I will be happy to rework my program into the tests (I must admit I haven't looked at them yet.) Best regards, (an(other)) Adam
Subject: test_leak
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1223477082-27688-15"
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: application/octet-stream; name="test_leak"
Content-Disposition: inline; filename="test_leak"
Content-Transfer-Encoding: base64
Content-Length: 1025
Download test_leak
application/octet-stream 1k

Message body not shown because it is not plain text.

MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-27668-1223477343-1084.39893-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
From: Adam Sjøgren
X-RT-Original-Encoding: utf-8
Content-Length: 198
Download (untitled) / with headers
text/plain 198b
Maybe I should have noted that I came across this in a larger application that uses Log4perl and BioPerl, and from what I gathered there created the small test-example attached. Best regards, Adam.
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00,DK_SIGNED,SPF_PASS
In-Reply-To: <rt-3.6.HEAD-27688-1223477089-1910.39893-4-0 [...] rt.cpan.org>
Content-Disposition: inline
References: <RT-Ticket-39893 [...] rt.cpan.org> <rt-3.6.HEAD-27688-1223477089-1910.39893-4-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Received: from x1.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 207A44D8068 for <bug-Devel-Leak-Object [...] rt.cpan.org>; Wed, 8 Oct 2008 12:06:12 -0400 (EDT)
Received: (qmail 17487 invoked from network); 8 Oct 2008 16:06:11 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 8 Oct 2008 16:06:11 -0000
Received: from mail-gx0-f21.google.com (HELO mail-gx0-f21.google.com) (209.85.217.21) by 16.mx.develooper.com (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Oct 2008 09:06:04 -0700
Received: by gxk14 with SMTP id 14so7967466gxk.21 for <bug-Devel-Leak-Object [...] rt.cpan.org>; Wed, 08 Oct 2008 09:06:00 -0700 (PDT)
Received: by 10.65.95.12 with SMTP id x12mr14053997qbl.15.1223481958946; Wed, 08 Oct 2008 09:05:58 -0700 (PDT)
Received: by 10.65.210.14 with HTTP; Wed, 8 Oct 2008 09:05:58 -0700 (PDT)
Delivered-To: cpan-bug+Devel-Leak-Object [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #39893] DESTROY not always called
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=dwvIY+cEQIkIvwAjA5wm/iy4NIBuzQIcHYJRiUUB/WiAgDWkmJ/GDdXTNDt28us5jE YPO3G+iWA3Wf+OwWWfgc4nKOIM79JrF4B6Vqha5OzaVPmyFV74t2WzACSUv/ojfBqC7q +2xlWAoNHNWUW6kKQtvJEtrt1VJ+/gE/iNn9k=
Return-Path: <adamkennedybackup [...] gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Uu1oH4AnDDJoZfcMtftaj8ZDzXVfREl6UJ+4+QmoEzY=; b=qB9tbNkoHqV2MbLGbdRxu2JVwNZivOqzuxJtVER6atdJDrvvE3pbuI2cU90SiQQr3C HhFK40df0mQa7Oq3Yxl+zH/ZY9T3bQQaR0JdT+kmi6s+fXLSaQDP9G+vH1DIQfUF70I/ gqiCyspHdS2aRE8YO9cOwmyPkHGSKBN2DdEvY=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Devel-Leak-Object [...] rt.cpan.org
Date: Thu, 9 Oct 2008 03:05:58 +1100
X-Spam-Level: *
Message-Id: <b8cb49a40810080905i2e4e3fe1g57046f63ec575d3b [...] mail.gmail.com>
To: bug-Devel-Leak-Object [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: "Adam Kennedy" <adamkennedybackup [...] gmail.com>
RT-Message-ID: <rt-3.6.HEAD-27678-1223481979-779.39893-0-0 [...] rt.cpan.org>
Content-Length: 3124
Thanks for the bug report, that test_leak program should be enough for me to build up a test script if needed. Adam K 2008/10/9 http://asjo.koldfront.dk/ via RT <bug-Devel-Leak-Object@rt.cpan.org>: Show quoted text
> Wed Oct 08 10:44:48 2008: Request 39893 was acted upon. > Transaction: Ticket created by http://asjo.koldfront.dk/ > Queue: Devel-Leak-Object > Subject: DESTROY not always called > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: asjo@koldfront.dk > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=39893 > > > > I am not sure this is a bug, but it seems to me like DESTROY isn't > always called the same number of times when Devel::Leak::Object > (GLOBAL_bless) is activated compared to when it isn't. I'm not sure that > it ought to, but I think so? > > I have created a little test-program (attached) that shows this. When I > run it, I get this output when D:L:O is commented out: > > car Car=HASH(0x6ecdd0) > * DESTROY Car=HASH(0x6ecdd0) > producer Producer=HASH(0x6ecdd0) > car Car=HASH(0x6ece20) > * DESTROY Car=HASH(0x6ece20) > * DESTROY Producer=HASH(0x6ecdd0) > car Car=HASH(0x6ece30) > * DESTROY Car=HASH(0x6ece30) > > which makes sense to me, I create a car and it is DESTROYed as it goes > out of scope, then a producer and a car, also DESTROYed, and finally > another car; DESTROYed. > > If I comment in Devel::Leak::Object qw{ GLOBAL_bless }, I get this output: > > Devel::Leak::Object version: 0.92 > car Car=HASH(0x736610) > * DESTROY Car=HASH(0x736610) > producer Producer=HASH(0x736610) > car Car=HASH(0x7461c0) > * DESTROY Producer=HASH(0x736610) > car Car=HASH(0x746140) > Tracked objects by class: > > Now, after I have created a producer, no cars are DESTROYed anymore! > > I think it has to do with how Devel::Leak::Object::DESTROY_NEXT is > populated and interpreted, because if I add a warn line like this: > > --- Object.pm.orig 2008-10-08 11:36:59.000000000 +0200 > +++ Object.pm 2008-10-08 16:35:14.000000000 +0200 > @@ -119,6 +119,7 @@ > } > my \$super = > \$Devel::Leak::Object::DESTROY_NEXT{\$original}->{'$class'}; > unless ( defined \$super ) { > + warn "Failed to find super-method for class \$class in package > $class"; > die "Failed to find super-method for class \$class in package > $class"; > } > if ( \$super ) { > > I get this output: > > Devel::Leak::Object version: 0.92 > car Car=HASH(0x736590) > * DESTROY Car=HASH(0x736590) > producer Producer=HASH(0x736590) > car Car=HASH(0x745980) > Failed to find super-method for class Car in package Producer at (eval > 5) line 46. > * DESTROY Producer=HASH(0x736590) > car Car=HASH(0x745900) > Failed to find super-method for class Car in package Producer at (eval > 5) line 46. > Tracked objects by class: > > I haven't really understood how the DESTROY_NEXT structure is supposed > to work, so I may very well be mistaken. > > If this is a bug, I will be happy to rework my program into the tests (I > must admit I haven't looked at them yet.) > > Best regards, (an(other)) Adam >


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.