[perl/f14/master] Do not leak when destroying thread

Petr Pisar ppisar at fedoraproject.org
Tue Sep 7 12:06:18 UTC 2010


commit c07a2fad0d3ccd2d39c7bb20264525349ff0c0e2
Author: Petr Písař <ppisar at redhat.com>
Date:   Mon Sep 6 18:17:39 2010 +0200

    Do not leak when destroying thread
    
    RT #77352, RHBZ #630667
    Fix picked up from blead upstream git branch.

 perl-5.12.1-fix_thread_leak.patch |   71 +++++++++++++++++++++++++++++++++++++
 perl.spec                         |   12 +++++-
 2 files changed, 81 insertions(+), 2 deletions(-)
---
diff --git a/perl-5.12.1-fix_thread_leak.patch b/perl-5.12.1-fix_thread_leak.patch
new file mode 100644
index 0000000..9e8645d
--- /dev/null
+++ b/perl-5.12.1-fix_thread_leak.patch
@@ -0,0 +1,71 @@
+commit 6ad76e39ed152a180816212ff7b4f798b1ab9bf0
+Author: Jirka Hruška <jirka at fud.cz>
+Date:   Wed Sep 1 11:18:43 2010 +0100
+
+    PL_my_cxt_list leaks
+    
+    [perl #77352]
+    
+    PL_my_cxt_list was never freed
+
+diff --git a/perl.c b/perl.c
+index dfb549d..0acd7ff 100644
+--- a/perl.c
++++ b/perl.c
+@@ -1069,6 +1069,10 @@ perl_destruct(pTHXx)
+ 			     (long)cxstack_ix + 1);
+     }
+ 
++    /* the entries in this list are allocated via SV PVX's, so get freed
++     * in sv_clean_all */
++    Safefree(PL_my_cxt_list);
++
+     /* Now absolutely destruct everything, somehow or other, loops or no. */
+ 
+     /* the 2 is for PL_fdpid and PL_strtab */
+
+commit 56d1e8d38e36ab7813af488eb8759b90bc82dd4a
+Author: Jirka Hruška <jirka at fud.cz>
+Date:   Wed Sep 1 10:59:35 2010 +0100
+
+    Memory leak cloning PVGVs
+    
+    [perl #77352]
+    
+    In S_sv_dup_common, Perl_rvpv_dup was called twice on a non-GP PVGV value,
+    causing the first duped value to be leaked
+
+diff --git a/AUTHORS b/AUTHORS
+index 24ac6c3..7fc93a1 100644
+--- a/AUTHORS
++++ b/AUTHORS
+@@ -487,6 +487,7 @@ Jim Meyering			<meyering at asic.sc.ti.com>
+ Jim Miner			<jfm at winternet.com>
+ Jim Richardson
+ Jim Schneider			<jschneid at netilla.com>
++Jirka Hruška			<jirka at fud.cz>
+ Joachim Huober
+ Jochen Wiedmann			<joe at ispsoft.de>
+ Jody Belka			<dev-perl at pimb.org>
+diff --git a/sv.c b/sv.c
+index b6c03ed..11587d4 100644
+--- a/sv.c
++++ b/sv.c
+@@ -11120,6 +11120,7 @@ Perl_sv_dup(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
+ 		else
+ 		    LvTARG(dstr) = sv_dup_inc(LvTARG(dstr), param);
+ 	    case SVt_PVGV:
++		/* non-GP case already handled above */
+ 		if(isGV_with_GP(sstr)) {
+ 		    GvNAME_HEK(dstr) = hek_dup(GvNAME_HEK(dstr), param);
+ 		    /* Don't call sv_add_backref here as it's going to be
+@@ -11143,8 +11144,7 @@ Perl_sv_dup(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
+ 		    }
+ 		    GvGP(dstr)	= gp_dup(GvGP(sstr), param);
+ 		    (void)GpREFCNT_inc(GvGP(dstr));
+-		} else
+-		    Perl_rvpv_dup(aTHX_ dstr, sstr, param);
++		}
+ 		break;
+ 	    case SVt_PVIO:
+ 		IoIFP(dstr)	= fp_dup(IoIFP(dstr), IoTYPE(dstr), param);
diff --git a/perl.spec b/perl.spec
index 4dc92a1..a05f529 100644
--- a/perl.spec
+++ b/perl.spec
@@ -12,7 +12,7 @@
 Name:           perl
 Version:        %{perl_version}
 # release number must be even higher, becase dual-lived modules will be broken otherwise
-Release:        132%{?dist}
+Release:        133%{?dist}
 Epoch:          %{perl_epoch}
 Summary:        Practical Extraction and Report Language
 Group:          Development/Languages
@@ -60,6 +60,9 @@ Patch7:         perl-5.10.0-x86_64-io-test-failure.patch
 # temporarily export debug symbols even though DEBUGGING is not set:
 #Patch8:         perl-add-symbols.patch
 
+# Do not leak when destroying thread; RT #77352, RHBZ #630667
+Patch9:         perl-5.12.1-fix_thread_leak.patch
+
 
 # Update some of the bundled modules
 # see http://fedoraproject.org/wiki/Perl/perl.spec for instructions
@@ -834,6 +837,7 @@ upstream tarball from perl.org.
 %patch7 -p1
 #debug symbols?
 #%patch8 -p1
+%patch9 -p1
 
 
 #
@@ -1031,7 +1035,8 @@ pushd %{build_archlib}/CORE/
     'Fedora Patch4: use libresolv instead of libbind' \
     'Fedora Patch5: USE_MM_LD_RUN_PATH' \
     'Fedora Patch6: Skip hostname tests, due to builders not being network capable' \
-    'Fedora Patch7: Dont run one io test due to random builder failures' 
+    'Fedora Patch7: Dont run one io test due to random builder failures' \
+    'Fedora Patch9: Do not leak when destroying thread; RT #77352' \
     %{nil}
 
 rm patchlevel.bak
@@ -1702,6 +1707,9 @@ rm -rf $RPM_BUILD_ROOT
 
 # Old changelog entries are preserved in CVS.
 %changelog
+* Tue Sep  7 2010 Petr Pisar <ppisar at redhat.com> - 4:5.12.2-133
+- Do not leak when destroying thread (RT #77352, RHBZ #630667)
+
 * Tue Sep  7 2010 Petr Sabata <psabata at redhat.com> - 5:5.12.2-132
 - Fixing release number for modules
 


More information about the scm-commits mailing list