[Bug 859910] New: Hint-hash copying can leak

bugzilla at redhat.com bugzilla at redhat.com
Mon Sep 24 11:43:09 UTC 2012


https://bugzilla.redhat.com/show_bug.cgi?id=859910

            Bug ID: 859910
        QA Contact: extras-qa at fedoraproject.org
          Severity: unspecified
               URL: https://rt.perl.org/rt3/Public/Bug/Display.html?id=107
                    000
           Version: 17
          Priority: unspecified
                CC: cweyl at alumni.drew.edu, iarnell at gmail.com,
                    jplesnik at redhat.com, kasal at ucw.cz, lkundrak at v3.sk,
                    mmaslano at redhat.com,
                    perl-devel at lists.fedoraproject.org, ppisar at redhat.com,
                    psabata at redhat.com, rc040203 at freenet.de,
                    tcallawa at redhat.com
          Assignee: ppisar at redhat.com
           Summary: Hint-hash copying can leak
        Regression: ---
      Story Points: ---
    Classification: Fedora
                OS: Unspecified
          Reporter: ppisar at redhat.com
              Type: Bug
     Documentation: ---
          Hardware: Unspecified
        Mount Type: ---
            Status: ASSIGNED
         Component: perl
           Product: Fedora

Dying in tied %^H leaks memory:

use Config;
use Test::LeakTrace;

# [perl #107000]
package hhtie {
    sub TIEHASH { bless [] }
    sub STORE    { $_[0][0]{$_[1]} = $_[2] }
    sub FETCH    { die if $explosive; $_[0][0]{$_[1]} }
    sub FIRSTKEY { keys %{$_[0][0]}; each %{$_[0][0]} }
    sub NEXTKEY  { each %{$_[0][0]} }
}
leaktrace {
    eval q`
       BEGIN {
           $hhtie::explosive = 0;
           tie %^H, hhtie;
           $^H{foo} = bar;
           $hhtie::explosive = 1;
       }
       { 1; }
    `;
};

Fixed in upstream with commit:

commit 0db511c03fa45894d146905ba3408b3be3f5baa0
Author: Father Chrysostomos <sprout at cpan.org>
Date:   Sun Sep 23 12:42:15 2012 -0700

    [perl #107000] Don’t leak if hh copying dies

Perl 5.14.2 as well as 5.16.1 (all Fedoras) are affected.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the perl-devel mailing list