commit 88d9e0fb9f68dfa4ffa4b64a20810b06b4ec897d Author: Jitka Plesnikova <jplesnik@xxxxxxxxxx> Date: Thu Oct 18 10:11:04 2012 +0200 Do not crash when vivifying $| ....1-perl-115206-Don-t-crash-when-vivifying.patch | 75 ++++++++++++++++++++ perl.spec | 10 +++- 2 files changed, 84 insertions(+), 1 deletions(-) --- diff --git a/perl-5.16.1-perl-115206-Don-t-crash-when-vivifying.patch b/perl-5.16.1-perl-115206-Don-t-crash-when-vivifying.patch new file mode 100644 index 0000000..9141946 --- /dev/null +++ b/perl-5.16.1-perl-115206-Don-t-crash-when-vivifying.patch @@ -0,0 +1,75 @@ +Ported to 5.16.1: + +From 4505a31f43ca4e1a0e9203b389f6d4bebab9d899 Mon Sep 17 00:00:00 2001 +From: Father Chrysostomos <sprout@xxxxxxxx> +Date: Tue, 9 Oct 2012 20:47:18 -0700 +Subject: [PATCH] =?UTF-8?q?[perl=20#115206]=20Don=E2=80=99t=20crash=20when=20?= + =?UTF-8?q?vivifying=20$|?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +It was trying to read the currently-selected handle without checking +whether it was selected. It is actually not necessary to initialise +the variable this way, as the next use of get-magic on it will clobber +the cached value. + +This initialisation was originally added in commit d8ce0c9a45. The +bug it was fixing was probably caused by missing FETCH calls that are +no longer missing. +--- + gv.c | 5 +---- + t/op/magic.t | 5 ++++- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/gv.c b/gv.c +index f352452..cf02ca4 100644 +--- a/gv.c ++++ b/gv.c +@@ -1913,10 +1913,6 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, + Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), + "$%c is no longer supported", *name); + break; +- case '|': /* $| */ +- sv_setiv(GvSVn(gv), (IV)(IoFLAGS(GvIOp(PL_defoutgv)) & IOf_FLUSH) != 0); +- goto magicalize; +- + case '\010': /* $^H */ + { + HV *const hv = GvHVn(gv); +@@ -1957,6 +1953,7 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, + case '>': /* $> */ + case '\\': /* $\ */ + case '/': /* $/ */ ++ case '|': /* $| */ + case '$': /* $$ */ + case '\001': /* $^A */ + case '\003': /* $^C */ +diff --git a/t/op/magic.t b/t/op/magic.t +index 3fb1ea1..1bcfbd9 100644 +--- a/t/op/magic.t ++++ b/t/op/magic.t +@@ -5,7 +5,7 @@ BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; + require './test.pl'; +- plan (tests => 156); ++ plan (tests => 157); + } + + # Test that defined() returns true for magic variables created on the fly, +@@ -581,6 +581,11 @@ SKIP: { + } + } + ++# $| ++fresh_perl_is ++ 'select f; undef *f; ${q/|/}; print STDOUT qq|ok\n|', "ok\n", {}, ++ '[perl #115206] no crash when vivifying $| while *{+select}{IO} is undef'; ++ + # ^^^^^^^^^ New tests go here ^^^^^^^^^ + + SKIP: { +-- +1.7.7.6 + diff --git a/perl.spec b/perl.spec index c48e248..36aca0f 100644 --- a/perl.spec +++ b/perl.spec @@ -26,7 +26,7 @@ Name: perl Version: %{perl_version} # release number must be even higher, because dual-lived modules will be broken otherwise -Release: 232%{?dist} +Release: 233%{?dist} Epoch: %{perl_epoch} Summary: Practical Extraction and Report Language Group: Development/Languages @@ -106,6 +106,9 @@ Patch17: perl-5.16.1-perl-105924-require-1-2.patch # Extend stack in File::Glob::glob, rhbz#859332, RT#114984, fixed after 5.17.4 Patch18: perl-5.16.1-perl-114984-Glob.xs-Extend-stack-when-returning.patch +# Do not crash when vivifying $|, rhbz#865296, RT#115206 +Patch19: perl-5.16.1-perl-115206-Don-t-crash-when-vivifying.patch + # Update some of the bundled modules # see http://fedoraproject.org/wiki/Perl/perl.spec for instructions @@ -1330,6 +1333,7 @@ tarball from perl.org. %patch16 -p1 %patch17 -p1 %patch18 -p1 +%patch19 -p1 #copy the example script cp -a %{SOURCE5} . @@ -1540,6 +1544,7 @@ pushd %{build_archlib}/CORE/ 'Fedora Patch16: Do not leak with attribute on my variable (RT#114764)' \ 'Fedora Patch17: Allow operator after numeric keyword argument (RT#105924)' \ 'Fedora Patch18: Extend stack in File::Glob::glob, (RT#114984)' \ + 'Fedora Patch19: Do not crash when vivifying $|' \ %{nil} rm patchlevel.bak @@ -2610,6 +2615,9 @@ sed \ # Old changelog entries are preserved in CVS. %changelog +* Wed Oct 17 2012 Jitka Plesnikova <jplesnik@xxxxxxxxxx> - 4:5.16.1-233 +- Do not crash when vivifying $| (bug #865296) + * Fri Sep 21 2012 Petr Pisar <ppisar@xxxxxxxxxx> - 4:5.16.1-232 - perl-PathTools uses Carp - Do not leak with attribute on my variable (bug #858966) -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl perl-devel mailing list perl-devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/perl-devel