New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak with 'use v5.8' #10737
Comments
From @ntyniThis is a bug report for perl from Niko Tyni <ntyni@debian.org>, As reported in <http://bugs.debian.org/600376> 'use v5.8' leaks bash -c 'ulimit -v 70000; ./perl -Ilib -e "eval q{use v5.8} while 1;"' Proposed patch attached. Flags: Site configuration information for perl 5.13.5: Configured by niko at Mon Oct 18 13:12:14 EEST 2010. Summary of my perl5 (revision 5 version 13 subversion 5) configuration: Locally applied patches: @INC for perl 5.13.5: Environment for perl 5.13.5: |
From @ntyni0001-Fix-a-memory-leak-with-use-v5.8.patchFrom 8c4c4c5d995b7f34046b0c3a6e391e600eef177c Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Tue, 19 Oct 2010 10:07:45 +0300
Subject: [PATCH] Fix a memory leak with 'use v5.8'
The leak was originally reported in http://bugs.debian.org/600376
---
pp_ctl.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pp_ctl.c b/pp_ctl.c
index a9d92f1..495f0fb 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3463,6 +3463,7 @@ PP(pp_require)
PL_hints |= (HINT_STRICT_REFS | HINT_STRICT_SUBS | HINT_STRICT_VARS);
}
}
+ SvREFCNT_dec(sv);
RETPUSHYES;
}
--
1.7.1
|
From @nwc10On Tue, Oct 19, 2010 at 12:18:05AM -0700, Niko Tyni wrote:
Thanks for the report and the proposed patch. I applied this instead: commit d086148 Stop 'use v5.8' leaking memory. Fixes #78436. Inline Patchdiff --git a/pp_ctl.c b/pp_ctl.c
index a9d92f1..16e7cf9 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3398,7 +3398,7 @@ PP(pp_require)
sv = POPs;
if ( (SvNIOKp(sv) || SvVOK(sv)) && PL_op->op_type != OP_DOFILE) {
- sv = new_version(sv);
+ sv = sv_2mortal(new_version(sv));
if (!sv_derived_from(PL_patchlevel, "version"))
upg_version(PL_patchlevel, TRUE);
if (cUNOP->op_first->op_type == OP_CONST && cUNOP->op_first->op_private
$ time bash -c 'ulimit -v 70000; ./perl -Ilib -e "eval q{use v5.16} while 1;"' real 0m0.985s I guess I had better open a new ticket for that. Nicholas Clark |
The RT System itself - Status changed from 'new' to 'open' |
@nwc10 - Status changed from 'open' to 'resolved' |
From @toddrOn Oct 19, 2010, at 6:35 AM, Nicholas Clark wrote:
This seems like it might be a security issue waiting to happen. Will this be back ported to 5.12? Todd |
From @JohnPeacockOn 10/19/2010 07:35 AM, Nicholas Clark wrote:
That marks the RV that is returned from new_version() as mortal. But Thoughts? John |
From zefram@fysh.orgJohn Peacock wrote:
Right, and this is the correct way to do it. The save stack deletes -zefram |
From @JohnPeacockOn 10/19/2010 03:44 PM, Zefram wrote:
That's what I thought, but using Test::LeakTrace, it is apparent that http://rt.perl.org/rt3/Public/Bug/Display.html?id=72686 That patch has effectively already been committed, FWIW... John |
From @nwc10On Tue, Oct 19, 2010 at 10:07:24AM -0500, Todd Rinaldo wrote:
I don't see why this is any more security issue than any other resource leak. I suspect that actually most other resource leaks are more serious than this (But if Debian which to backport it for their distribution, that's their call.) Nicholas Clark |
From @cpansproutOn Tue Oct 19 13:17:19 2010, john.peacock@havurah-software.org wrote:
Does that mean 72686 can be closed? |
Migrated from rt.perl.org#78436 (status was 'resolved')
Searchable as RT78436$
The text was updated successfully, but these errors were encountered: