Skip Menu |

This queue is for tickets about the B-Generate CPAN distribution.

Report information
The Basics
Id: 36924
Status: resolved
Priority: 0/
Queue: B-Generate

People
Owner: Nobody in particular
Requestors: tobez [...] tobez.org
Cc:
AdminCc:

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



Subject: $op->sv memory leak introduced by B::Generate
Date: Thu, 19 Jun 2008 15:48:47 +0200
To: bug-B-Generate [...] rt.cpan.org
From: Anton Berezin <tobez [...] tobez.org>
Hi, Consider the following little test case: ----------8<-----------8<-----------8<-----------8<-----------8<------ #! /usr/bin/perl use warnings; use strict; use Devel::Leak; use B; use B::Generate; my $h; print "0: ", Devel::Leak::NoteSV($h), "\n"; cc(); print "1: ", Devel::Leak::NoteSV($h), "\n"; cc(); print "2: ", Devel::Leak::NoteSV($h), "\n"; cc(); print "3: ", Devel::Leak::NoteSV($h), "\n"; sub cc { check(sub { return "heps" . $_[0] . "be" . $_[1] . "4" }); } sub check { my ($sub) = @_; my $root = B::svref_2object($sub); $root = $root->ROOT; my @op = get_all_children($root); for my $op (@op) { if ($op->can("sv")) { my $sv = $op->sv; } } } sub get_all_children { my ($op) = @_; my @op; if ($op->can("first")) { push @op, $op->first, get_all_children($op->first); } if ($op->can("sibling")) { push @op, $op->sibling, get_all_children($op->sibling); } @op; } ----------8<-----------8<-----------8<-----------8<-----------8<------ On my machine, running this produces 0: 6517 1: 6874 2: 6879 3: 6884 If I comment out the "use B::Generate" statement above, the same code produces 0: 5976 1: 6328 2: 6328 3: 6328 So there is a leak somewhere in the B::Generate's version of $op->sv. Unfortunately, I lack the knowledge of perl guts to come up with a patch, but I do hope it is addressed. Thanks for the module, Cheers, \Anton. -- We're going for 'working' here. 'clean' is for people with skills... -- Flemming Jacobsen
CC: rt-cpan-admin [...] bestpractical.com
Subject: Re: [rt.cpan.org #36924] AutoReply: $op->sv memory leak introduced by B::Generate
Date: Fri, 20 Jun 2008 20:10:57 +0200
To: Bugs in B-Generate via RT <bug-B-Generate [...] rt.cpan.org>
From: Anton Berezin <tobez [...] tobez.org>
On Fri, Jun 20, 2008 at 02:07:02PM -0400, Bugs in B-Generate via RT wrote: Show quoted text
> > Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "$op->sv memory leak introduced by B::Generate", > a summary of which appears below.
Please close this ticket, it is a duplicate of 36845. However, the ticket was created about 30 hours after the mail was sent; I am wondering whether it is how rt.cpan.org is supposed to work... Cheers, \Anton. -- We're going for 'working' here. 'clean' is for people with skills... -- Flemming Jacobsen