rpms/perl/F-10 perl-5.10.0-much-better-swap-logic.patch, NONE, 1.1 perl-5.10.0-spamassassin.patch, NONE, 1.1 perl-bz509676.patch, NONE, 1.1 perl.spec, 1.214, 1.215
Marcela Mašláňová
mmaslano at fedoraproject.org
Fri Oct 9 11:37:03 UTC 2009
Author: mmaslano
Update of /cvs/pkgs/rpms/perl/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv385
Modified Files:
perl.spec
Added Files:
perl-5.10.0-much-better-swap-logic.patch
perl-5.10.0-spamassassin.patch perl-bz509676.patch
Log Message:
* Fri Oct 9 2009 Marcela Mašláňová <mmaslano at redhat.com> - 4:5.10.0-74
- 510127 spam assassin suffer from tainted bug
- 494773 much better swap logic to support reentrancy and fix assert failure (rt #60508)
- fix generated .ph files so that they no longer cause warnings (#509676)
perl-5.10.0-much-better-swap-logic.patch:
embed.fnc | 1
embed.h | 2 -
ext/Devel/PPPort/parts/embed.fnc | 1
proto.h | 3 --
regcomp.c | 2 -
regexec.c | 44 +++++++++++++++------------------------
regexp.h | 2 -
t/op/pat.t | 19 +++++++++++++++-
8 files changed, 36 insertions(+), 38 deletions(-)
--- NEW FILE perl-5.10.0-much-better-swap-logic.patch ---
diff -up perl-5.10.0/embed.fnc.much perl-5.10.0/embed.fnc
--- perl-5.10.0/embed.fnc.much 2009-07-27 08:31:33.839374246 +0200
+++ perl-5.10.0/embed.fnc 2009-07-27 08:32:05.322374620 +0200
@@ -1441,7 +1441,6 @@ ERsn |U8* |reghop4 |NN U8 *pos|I32 off|N
#endif
ERsn |U8* |reghopmaybe3 |NN U8 *pos|I32 off|NN const U8 *lim
ERs |char* |find_byclass |NN regexp * prog|NN const regnode *c|NN char *s|NN const char *strend|NULLOK regmatch_info *reginfo
-Es |void |swap_match_buff|NN regexp * prog
Es |void |to_utf8_substr |NN regexp * prog
Es |void |to_byte_substr |NN regexp * prog
ERs |I32 |reg_check_named_buff_matched |NN const regexp *rex|NN const regnode *prog
diff -up perl-5.10.0/embed.h.much perl-5.10.0/embed.h
--- perl-5.10.0/embed.h.much 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/embed.h 2009-07-27 08:31:34.016378805 +0200
@@ -1426,7 +1426,6 @@
#if defined(PERL_CORE) || defined(PERL_EXT)
#define reghopmaybe3 S_reghopmaybe3
#define find_byclass S_find_byclass
-#define swap_match_buff S_swap_match_buff
#define to_utf8_substr S_to_utf8_substr
#define to_byte_substr S_to_byte_substr
#define reg_check_named_buff_matched S_reg_check_named_buff_matched
@@ -3714,7 +3713,6 @@
#if defined(PERL_CORE) || defined(PERL_EXT)
#define reghopmaybe3 S_reghopmaybe3
#define find_byclass(a,b,c,d,e) S_find_byclass(aTHX_ a,b,c,d,e)
-#define swap_match_buff(a) S_swap_match_buff(aTHX_ a)
#define to_utf8_substr(a) S_to_utf8_substr(aTHX_ a)
#define to_byte_substr(a) S_to_byte_substr(aTHX_ a)
#define reg_check_named_buff_matched(a,b) S_reg_check_named_buff_matched(aTHX_ a,b)
diff -up perl-5.10.0/ext/Devel/PPPort/parts/embed.fnc.much perl-5.10.0/ext/Devel/PPPort/parts/embed.fnc
--- perl-5.10.0/ext/Devel/PPPort/parts/embed.fnc.much 2007-12-18 11:47:07.000000000 +0100
+++ perl-5.10.0/ext/Devel/PPPort/parts/embed.fnc 2009-07-27 08:32:58.859374528 +0200
@@ -1436,7 +1436,6 @@ ERsn |U8* |reghop4 |NN U8 *pos|I32 off|N
#endif
ERsn |U8* |reghopmaybe3 |NN U8 *pos|I32 off|NN const U8 *lim
ERs |char* |find_byclass |NN regexp * prog|NN const regnode *c|NN char *s|NN const char *strend|NULLOK regmatch_info *reginfo
-Es |void |swap_match_buff|NN regexp * prog
Es |void |to_utf8_substr |NN regexp * prog
Es |void |to_byte_substr |NN regexp * prog
ERs |I32 |reg_check_named_buff_matched |NN const regexp *rex|NN const regnode *prog
diff -up perl-5.10.0/pod/perlapi.pod.much perl-5.10.0/pod/perlapi.pod
diff -up perl-5.10.0/pod/perlguts.pod.much perl-5.10.0/pod/perlguts.pod
diff -up perl-5.10.0/proto.h.much perl-5.10.0/proto.h
--- perl-5.10.0/proto.h.much 2009-07-27 08:31:33.000000000 +0200
+++ perl-5.10.0/proto.h 2009-07-27 08:35:52.103374484 +0200
@@ -3851,9 +3851,6 @@ STATIC char* S_find_byclass(pTHX_ regexp
__attribute__nonnull__(pTHX_3)
__attribute__nonnull__(pTHX_4);
-STATIC void S_swap_match_buff(pTHX_ regexp * prog)
- __attribute__nonnull__(pTHX_1);
-
STATIC void S_to_utf8_substr(pTHX_ regexp * prog)
__attribute__nonnull__(pTHX_1);
diff -up perl-5.10.0/regcomp.c.much perl-5.10.0/regcomp.c
--- perl-5.10.0/regcomp.c.much 2009-07-27 08:31:33.000000000 +0200
+++ perl-5.10.0/regcomp.c 2009-07-27 08:37:09.598625044 +0200
@@ -9167,7 +9167,6 @@ Perl_pregfree(pTHX_ struct regexp *r)
if (r->saved_copy)
SvREFCNT_dec(r->saved_copy);
#endif
- Safefree(r->swap);
Safefree(r->offs);
Safefree(r);
}
@@ -9216,7 +9215,6 @@ Perl_reg_temp_copy (pTHX_ struct regexp
ret->saved_copy = NULL;
#endif
ret->mother_re = r;
- ret->swap = NULL;
return ret;
}
diff -up perl-5.10.0/regexec.c.much perl-5.10.0/regexec.c
--- perl-5.10.0/regexec.c.much 2007-12-18 11:47:08.000000000 +0100
+++ perl-5.10.0/regexec.c 2009-07-27 08:40:15.966404877 +0200
@@ -1718,26 +1718,6 @@ S_find_byclass(pTHX_ regexp * prog, cons
return s;
}
-static void
-S_swap_match_buff (pTHX_ regexp *prog) {
- regexp_paren_pair *t;
-
- if (!prog->swap) {
- /* We have to be careful. If the previous successful match
- was from this regex we don't want a subsequent paritally
- successful match to clobber the old results.
- So when we detect this possibility we add a swap buffer
- to the re, and switch the buffer each match. If we fail
- we switch it back, otherwise we leave it swapped.
- */
- Newxz(prog->swap, (prog->nparens + 1), regexp_paren_pair);
- }
- t = prog->swap;
- prog->swap = prog->offs;
- prog->offs = t;
-}
-
-
/*
- regexec_flags - match a regexp against a string
*/
@@ -1765,7 +1745,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const
I32 multiline;
RXi_GET_DECL(prog,progi);
regmatch_info reginfo; /* create some info to pass to regtry etc */
- bool swap_on_fail = 0;
+ regexp_paren_pair *swap = NULL;
GET_RE_DEBUG_FLAGS_DECL;
@@ -1843,9 +1823,16 @@ Perl_regexec_flags(pTHX_ REGEXP * const
reginfo.ganch = strbeg;
}
if (PL_curpm && (PM_GETRE(PL_curpm) == prog)) {
- swap_on_fail = 1;
- swap_match_buff(prog); /* do we need a save destructor here for
- eval dies? */
+ /* We have to be careful. If the previous successful match
+ was from this regex we don't want a subsequent partially
+ successful match to clobber the old results.
+ So when we detect this possibility we add a swap buffer
+ to the re, and switch the buffer each match. If we fail
+ we switch it back, otherwise we leave it swapped.
+ */
+ swap = prog->offs;
+ /* do we need a save destructor here for eval dies? */
+ Newxz(prog->offs, (prog->nparens + 1), regexp_paren_pair);
}
if (!(flags & REXEC_CHECKED) && (prog->check_substr != NULL || prog->check_utf8 != NULL)) {
re_scream_pos_data d;
@@ -2144,6 +2131,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const
goto phooey;
got_it:
+ Safefree(swap);
RX_MATCH_TAINTED_set(prog, PL_reg_flags & RF_tainted);
if (PL_reg_eval_set)
@@ -2189,10 +2177,12 @@ phooey:
PL_colors[4], PL_colors[5]));
if (PL_reg_eval_set)
restore_pos(aTHX_ prog);
- if (swap_on_fail)
+ if (swap) {
/* we failed :-( roll it back */
- swap_match_buff(prog);
-
+ Safefree(prog->offs);
+ prog->offs = swap;
+ }
+
return 0;
}
diff -up perl-5.10.0/regexp.h.much perl-5.10.0/regexp.h
--- perl-5.10.0/regexp.h.much 2007-12-18 11:47:08.000000000 +0100
+++ perl-5.10.0/regexp.h 2009-07-27 08:41:06.882374786 +0200
@@ -88,7 +88,7 @@ typedef struct regexp {
/* Data about the last/current match. These are modified during matching*/
U32 lastparen; /* last open paren matched */
U32 lastcloseparen; /* last close paren matched */
- regexp_paren_pair *swap; /* Swap copy of *offs */
+ regexp_paren_pair *swap; /* Unused: 5.10.1 and later */
regexp_paren_pair *offs; /* Array of offsets for (@-) and (@+) */
char *subbeg; /* saved or original string
diff -up perl-5.10.0/t/op/pat.t.much perl-5.10.0/t/op/pat.t
--- perl-5.10.0/t/op/pat.t.much 2007-12-18 11:47:08.000000000 +0100
+++ perl-5.10.0/t/op/pat.t 2009-07-27 08:44:50.343375513 +0200
@@ -4558,10 +4558,27 @@ ok($@=~/\QSequence \k... not terminated
ok("aaa" =~ /$s/, "#45337");
}
+# This only works under -DEBUGGING because it relies on an assert().
+{
+ local $BugId = '60508';
+ local $Message = "Check capture offset re-entrancy of utf8 code.";
+
+ sub fswash { $_[0] =~ s/([>X])//g; }
+ my $k1 = "." x 4 . ">>";
+ fswash($k1);
+
+ my $k2 = "\x{f1}\x{2022}";
+ $k2 =~ s/([\360-\362])/>/g;
+ fswash($k2);
+
+ iseq($k2, "\x{2022}", "utf8::SWASHNEW doesn't cause capture leaks");
+}
+
# Put new tests above the dotted line about a page above this comment
iseq(0+$::test,$::TestCount,"Got the right number of tests!");
# Don't forget to update this!
BEGIN {
- $::TestCount = 4013;
+ $::TestCount = 4014;
print "1..$::TestCount\n";
}
+
perl-5.10.0-spamassassin.patch:
Basename.pm | 1 +
1 file changed, 1 insertion(+)
--- NEW FILE perl-5.10.0-spamassassin.patch ---
diff -up perl-5.10.0/lib/File/Basename.pm.spam perl-5.10.0/lib/File/Basename.pm
--- perl-5.10.0/lib/File/Basename.pm.spam 2009-07-27 08:45:18.000000000 +0200
+++ perl-5.10.0/lib/File/Basename.pm 2009-07-28 09:01:54.757410886 +0200
@@ -331,6 +331,7 @@ sub dirname {
sub _strip_trailing_sep {
my $type = $Fileparse_fstype;
+ local $1;
if ($type eq 'MacOS') {
$_[0] =~ s/([^:]):\z/$1/s;
}
perl-bz509676.patch:
lib/h2ph.t | 10 +++++++++-
t/lib/h2ph.h | 6 ++++++
t/lib/h2ph.pht | 24 ++++++++++++++----------
utils/h2ph.PL | 2 +-
4 files changed, 30 insertions(+), 12 deletions(-)
--- NEW FILE perl-bz509676.patch ---
commit 345d607e7958b7f31d5f0c780e86d1cc3e658d99
Author: Niko Tyni <ntyni at debian.org>
Date: Tue Apr 14 22:55:34 2009 +0300
Squelch 'Constant subroutine ... undefined' warnings from .ph files
As reported by Christopher Zimmermann in <http://bugs.debian.org/379757>,
code generated from simple #undef directives by h2ph can cause
'Constant subroutine ... undefined' warnings if the undefined
function was eligible for inlining.
(cherry picked from commit c0cc52e96e988526754ef533bd76595720660db2)
commit 2d375d52dd1895b26a80209dd64a3c11b9e3b532
Author: Niko Tyni <ntyni at debian.org>
Date: Tue Apr 14 22:55:33 2009 +0300
Add tests to verify that h2ph output compiles and is warning free
The #include directives are #ifdef'd out so that running the
resulting code does not actually need the headers. We still
get the same effect from comparing with the expected h2ph output.
(cherry picked from commit c1a2df7619e7315b8fccef3b9fa56bb8d7df3845)
diff --git a/lib/h2ph.t b/lib/h2ph.t
index 7b339b3..e303406 100755
--- a/lib/h2ph.t
+++ b/lib/h2ph.t
@@ -15,7 +15,7 @@ if (!(-e $extracted_program)) {
exit 0;
}
-print "1..2\n";
+print "1..4\n";
# quickly compare two text files
sub txt_compare {
@@ -32,6 +32,14 @@ print(($ok == 0 ? "" : "not "), "ok 1\n");
$ok = txt_compare("lib/h2ph.ph", "lib/h2ph.pht");
print(($ok == 0 ? "" : "not "), "ok 2\n");
+# does the output compile?
+$ok = system($^X, "-I../lib", "lib/h2ph.pht");
+print(($ok == 0 ? "" : "not "), "ok 3\n");
+
+# is the output warning free?
+$ok = system($^X, "-w", "-I../lib", "-e", '$SIG{__WARN__} = sub { die $_[0] }; require "lib/h2ph.pht"');
+print(($ok == 0 ? "" : "not "), "ok 4\n");
+
# cleanup - should this be in an END block?
unlink("lib/h2ph.ph");
unlink("_h2ph_pre.ph");
diff --git a/t/lib/h2ph.h b/t/lib/h2ph.h
index 495789a..78429ca 100644
--- a/t/lib/h2ph.h
+++ b/t/lib/h2ph.h
@@ -26,6 +26,10 @@
#undef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
+/* Test #undef'ining an existing constant function */
+#define NOTTRUE 0
+#undef NOTTRUE
+
/* Test #ifdef */
#ifdef __SOME_UNIMPORTANT_PROPERTY
#define MIN(a,b) ((a) < (b) ? (a) : (b))
@@ -68,9 +72,11 @@ function Tru64_Pascal(n: Integer): Integer;
* with `use lib qw(/opt/perl5/lib/site_perl/i586-linux/linux);' or whatever
* your equivalent is...
*/
+#if 0
#include <sys/socket.h>
#import "sys/ioctl.h"
#include_next <sys/fcntl.h>
+#endif
/* typedefs should be ignored */
typedef struct a_struct {
diff --git a/t/lib/h2ph.pht b/t/lib/h2ph.pht
index 145e682..3723fca 100644
--- a/t/lib/h2ph.pht
+++ b/t/lib/h2ph.pht
@@ -1,6 +1,6 @@
require '_h2ph_pre.ph';
-no warnings 'redefine';
+no warnings qw(redefine misc);
unless(defined(&SQUARE)) {
sub SQUARE {
@@ -22,6 +22,8 @@ unless(defined(&_H2PH_H_)) {
my($a,$b) = @_;
eval q((($a) > ($b) ? ($a) : ($b)));
}' unless defined(&MAX);
+ eval 'sub NOTTRUE () {0;}' unless defined(&NOTTRUE);
+ undef(&NOTTRUE) if defined(&NOTTRUE);
if(defined(&__SOME_UNIMPORTANT_PROPERTY)) {
eval 'sub MIN {
my($a,$b) = @_;
@@ -47,15 +49,17 @@ unless(defined(&_H2PH_H_)) {
} else {
eval 'sub WHATEVER () {1000;}' unless defined(&WHATEVER);
}
- require 'sys/socket.ph';
- require 'sys/ioctl.ph';
- eval {
- my(@REM);
- my(%INCD) = map { $INC{$_} => 1 } (grep { $_ eq "sys/fcntl.ph" } keys(%INC));
- @REM = map { "$_/sys/fcntl.ph" } (grep { not exists($INCD{"$_/sys/fcntl.ph"}) and -f "$_/sys/fcntl.ph" } @INC);
- require "$REM[0]" if @REM;
- };
- warn($@) if $@;
+ if(0) {
+ require 'sys/socket.ph';
+ require 'sys/ioctl.ph';
+ eval {
+ my(@REM);
+ my(%INCD) = map { $INC{$_} => 1 } (grep { $_ eq "sys/fcntl.ph" } keys(%INC));
+ @REM = map { "$_/sys/fcntl.ph" } (grep { not exists($INCD{"$_/sys/fcntl.ph"}) and -f "$_/sys/fcntl.ph" } @INC);
+ require "$REM[0]" if @REM;
+ };
+ warn($@) if $@;
+ }
eval("sub sun () { 0; }") unless defined(&sun);
eval("sub mon () { 1; }") unless defined(&mon);
eval("sub tue () { 2; }") unless defined(&tue);
diff --git a/utils/h2ph.PL b/utils/h2ph.PL
index 6f40126..4e99a7a 100644
--- a/utils/h2ph.PL
+++ b/utils/h2ph.PL
@@ -123,7 +123,7 @@ while (defined (my $file = next_file())) {
print OUT
"require '_h2ph_pre.ph';\n\n",
- "no warnings 'redefine';\n\n";
+ "no warnings qw(redefine misc);\n\n";
while (defined (local $_ = next_line($file))) {
if (s/^\s*\#\s*//) {
Index: perl.spec
===================================================================
RCS file: /cvs/pkgs/rpms/perl/F-10/perl.spec,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -p -r1.214 -r1.215
--- perl.spec 7 Jul 2009 13:45:22 -0000 1.214
+++ perl.spec 9 Oct 2009 11:37:03 -0000 1.215
@@ -7,7 +7,7 @@
Name: perl
Version: %{perl_version}
-Release: 73%{?dist}
+Release: 74%{?dist}
Epoch: %{perl_epoch}
Summary: Practical Extraction and Report Language
Group: Development/Languages
@@ -184,6 +184,17 @@ Patch57: 38_fix_weaken_memleak
# http://rt.perl.org/rt3/Ticket/Display.html?id=39060 (#221113)
Patch58: perl-perlio-incorrect-errno.patch
+# h2ph: generated *.ph files no longer produce warnings when processed
+Patch59: perl-bz509676.patch
+
+# much better swap logic to support reentrancy and fix assert failure
+# http://perl5.git.perl.org/perl.git/commitdiff/e9105d30edfbaa7f444bc7984c9bafc8e991ad12
+# RT #60508
+Patch61: perl-5.10.0-much-better-swap-logic.patch
+
+# https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6148
+Patch62: perl-5.10.0-spamassassin.patch
+
# Update some of the bundled modules
# see http://fedoraproject.org/wiki/Perl/perl.spec for instructions
Patch100: perl-update-constant.patch
@@ -987,6 +998,9 @@ upstream tarball from perl.org.
%patch56 -p1
%patch57 -p1
%patch58 -p1
+%patch59 -p1
+%patch61 -p1
+%patch62 -p1
%patch100 -p1
%patch101 -p1
@@ -1256,6 +1270,9 @@ perl -x patchlevel.h \
'Fedora Patch56: Fix $? when dumping core' \
'34209 Fix a memory leak with Scalar::Util::weaken()' \
'fix RT 39060, errno incorrectly set in perlio' \
+ 'Fedora Patch59: h2ph: generated *.ph files no longer produce warnings when processed' \
+ 'Fedora Patch61: much better swap logic to support reentrancy and fix assert failure' \
+ 'Fedora Patch62: spam assassin needs workaround for removing tainted mode' \
'Fedora Patch100: Update module constant to %{constant_version}' \
'Fedora Patch101: Update Archive::Extract to %{Archive_Extract_version}' \
'Fedora Patch102: Update Archive::Tar to %{Archive_Tar_version}' \
@@ -1902,6 +1919,11 @@ TMPDIR="$PWD/tmp" make test
# Old changelog entries are preserved in CVS.
%changelog
+* Fri Oct 9 2009 Marcela Mašláňová <mmaslano at redhat.com> - 4:5.10.0-74
+- 510127 spam assassin suffer from tainted bug
+- 494773 much better swap logic to support reentrancy and fix assert failure (rt #60508)
+- fix generated .ph files so that they no longer cause warnings (#509676)
+
* Tue Jul 7 2009 Stepan Kasal <skasal at redhat.com> - 4:5.10.0-73
- re-enable tests
More information about the fedora-extras-commits
mailing list