summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2013-06-17 06:54:13 +0000
committerwiz <wiz@pkgsrc.org>2013-06-17 06:54:13 +0000
commit319e177d7b1b07a3d29e0fd2d0687bcc6718e2ff (patch)
treeb0313a322b693db2f7aa50ba746dd84b1350b157 /lang
parent688053747eeccc7918b1b330f040132ca42fc772 (diff)
downloadpkgsrc-319e177d7b1b07a3d29e0fd2d0687bcc6718e2ff.tar.gz
Add patch from upstream git to try fixing test failures on 32bit NetBSD.
From http://perl5.git.perl.org/perl.git/commitdiff/4149c7198d9b78d861df289cce40dd865cab57e7 Bump PKGREVISION.
Diffstat (limited to 'lang')
-rw-r--r--lang/perl5/Makefile3
-rw-r--r--lang/perl5/distinfo4
-rw-r--r--lang/perl5/patches/patch-regexec.c64
-rw-r--r--lang/perl5/patches/patch-t_re_pat__rt__report.t59
4 files changed, 128 insertions, 2 deletions
diff --git a/lang/perl5/Makefile b/lang/perl5/Makefile
index 7c0f3fe3fa6..a0b67d74534 100644
--- a/lang/perl5/Makefile
+++ b/lang/perl5/Makefile
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.203 2013/06/17 05:21:45 obache Exp $
+# $NetBSD: Makefile,v 1.204 2013/06/17 06:54:13 wiz Exp $
.include "license.mk"
.include "Makefile.common"
+PKGREVISION= 1
COMMENT= Practical Extraction and Report Language
CONFLICTS= perl-base-[0-9]* perl-thread-[0-9]* \
diff --git a/lang/perl5/distinfo b/lang/perl5/distinfo
index de8ce16ee71..ee30b376856 100644
--- a/lang/perl5/distinfo
+++ b/lang/perl5/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.101 2013/06/08 21:39:23 schmonz Exp $
+$NetBSD: distinfo,v 1.102 2013/06/17 06:54:13 wiz Exp $
SHA1 (perl-5.18.0.tar.gz) = f5a97a9fa4e9d0ef9c4b313c5b778a0e76291ee2
RMD160 (perl-5.18.0.tar.gz) = 10774aa60a76b30579aedf23f4a21775301e3235
@@ -15,6 +15,8 @@ SHA1 (patch-cn) = d1877383e213a414562b5bb4c1e8aa785926fab7
SHA1 (patch-hints_cygwin.sh) = 1b21d927d6b7379754c4cd64a2b05d3632c35470
SHA1 (patch-hints_netbsd.sh) = 8a0656a72e81461f461757712b7fc27ad8928028
SHA1 (patch-hv.c) = 0ed39926d620724db6d612a717d84b4efa129162
+SHA1 (patch-regexec.c) = 4fb7840347bd08739ae2dcb3d133212474e168fc
+SHA1 (patch-t_re_pat__rt__report.t) = 139161459885bda91a2cbd0f96c57d6d88e52713
SHA1 (patch-ta) = a9d13eeec22733e4087942f217a0d47a19498a6f
SHA1 (patch-zd) = 469602bc04b217f2d9929f5caeab43f77a74076f
SHA1 (patch-ze) = 211ed6065ecf2ca02f8e95283c2d67a64c2e6b41
diff --git a/lang/perl5/patches/patch-regexec.c b/lang/perl5/patches/patch-regexec.c
new file mode 100644
index 00000000000..25f4d9785ed
--- /dev/null
+++ b/lang/perl5/patches/patch-regexec.c
@@ -0,0 +1,64 @@
+$NetBSD: patch-regexec.c,v 1.1 2013/06/17 06:54:13 wiz Exp $
+
+Fix regmatch pointer 32-bit wraparound regression
+
+Cherry-picked from:
+
+commit 285a3ca139d04d2ee1894c9a9110294ee8bb0309
+Merge: aad0429 dfb8f19
+Author: Tony Cook <tony@develop-help.com>
+AuthorDate: Mon Jun 3 22:28:37 2013 +1000
+Commit: Tony Cook <tony@develop-help.com>
+CommitDate: Mon Jun 3 22:28:37 2013 +1000
+
+ [perl #118175] avoid making pointers outside of objects
+
+ In a couple of cases, when strings were allocated above the 2GB line
+ on 32-bit CPUs, this could cause regexps to act strangely - not matching
+ or crashing perl.
+
+ The final patch in the set prevents pointer creation which the C standard
+ describes as undefined behaviour, but is typically safe (as long as the
+ pointer isn't derefed)
+
+This regression was introduced into 5.18.0 by commit
+4063ade8503ac8877a02fc4eae8ebbe242b9110b.
+
+--- regexec.c.orig 2013-05-05 19:32:18.000000000 +0000
++++ regexec.c
+@@ -6662,7 +6662,7 @@ S_regrepeat(pTHX_ regexp *prog, char **s
+ scan = *startposp;
+ if (max == REG_INFTY)
+ max = I32_MAX;
+- else if (! utf8_target && scan + max < loceol)
++ else if (! utf8_target && loceol - scan > max)
+ loceol = scan + max;
+
+ /* Here, for the case of a non-UTF-8 target we have adjusted <loceol> down
+@@ -6711,7 +6711,7 @@ S_regrepeat(pTHX_ regexp *prog, char **s
+ scan = loceol;
+ break;
+ case CANY: /* Move <scan> forward <max> bytes, unless goes off end */
+- if (utf8_target && scan + max < loceol) {
++ if (utf8_target && loceol - scan > max) {
+
+ /* <loceol> hadn't been adjusted in the UTF-8 case */
+ scan += max;
+@@ -6730,7 +6730,7 @@ S_regrepeat(pTHX_ regexp *prog, char **s
+ * can use UTF8_IS_INVARIANT() even if the pattern isn't UTF-8, as it's
+ * true iff it doesn't matter if the argument is in UTF-8 or not */
+ if (UTF8_IS_INVARIANT(c) || (! utf8_target && ! is_utf8_pat)) {
+- if (utf8_target && scan + max < loceol) {
++ if (utf8_target && loceol - scan > max) {
+ /* We didn't adjust <loceol> because is UTF-8, but ok to do so,
+ * since here, to match at all, 1 char == 1 byte */
+ loceol = scan + max;
+@@ -6910,7 +6910,7 @@ S_regrepeat(pTHX_ regexp *prog, char **s
+ /* FALLTHROUGH */
+
+ case POSIXA:
+- if (utf8_target && scan + max < loceol) {
++ if (utf8_target && loceol - scan > max) {
+
+ /* We didn't adjust <loceol> at the beginning of this routine
+ * because is UTF-8, but it is actually ok to do so, since here, to
diff --git a/lang/perl5/patches/patch-t_re_pat__rt__report.t b/lang/perl5/patches/patch-t_re_pat__rt__report.t
new file mode 100644
index 00000000000..16485d6aeef
--- /dev/null
+++ b/lang/perl5/patches/patch-t_re_pat__rt__report.t
@@ -0,0 +1,59 @@
+$NetBSD: patch-t_re_pat__rt__report.t,v 1.1 2013/06/17 06:54:13 wiz Exp $
+
+Fix regmatch pointer 32-bit wraparound regression
+
+Cherry-picked from:
+
+commit 285a3ca139d04d2ee1894c9a9110294ee8bb0309
+Merge: aad0429 dfb8f19
+Author: Tony Cook <tony@develop-help.com>
+AuthorDate: Mon Jun 3 22:28:37 2013 +1000
+Commit: Tony Cook <tony@develop-help.com>
+CommitDate: Mon Jun 3 22:28:37 2013 +1000
+
+ [perl #118175] avoid making pointers outside of objects
+
+ In a couple of cases, when strings were allocated above the 2GB line
+ on 32-bit CPUs, this could cause regexps to act strangely - not matching
+ or crashing perl.
+
+ The final patch in the set prevents pointer creation which the C standard
+ describes as undefined behaviour, but is typically safe (as long as the
+ pointer isn't derefed)
+
+This regression was introduced into 5.18.0 by commit
+4063ade8503ac8877a02fc4eae8ebbe242b9110b.
+
+--- t/re/pat_rt_report.t.orig 2013-05-01 02:52:56.000000000 +0000
++++ t/re/pat_rt_report.t
+@@ -22,7 +22,7 @@ BEGIN {
+ }
+
+
+-plan tests => 2530; # Update this when adding/deleting tests.
++plan tests => 2532; # Update this when adding/deleting tests.
+
+ run_tests() unless caller;
+
+@@ -1158,6 +1158,21 @@ EOP
+ '$_ = "abc"; /b/g; $_ = "hello"; print eval q|$\'|,"\n"',
+ "c\n", {}, '$\' first mentioned after match');
+ }
++
++ {
++ # [perl #118175] threaded perl-5.18.0 fails pat_rt_report_thr.t
++ # this tests some related failures
++ #
++ # The tests in the block *only* fail when run on 32-bit systems
++ # with a malloc that allocates above the 2GB line. On the system
++ # in the report above that only happened in a thread.
++ my $s = "\x{1ff}" . "f" x 32;
++ ok($s =~ /\x{1ff}[[:alpha:]]+/gca, "POSIXA pointer wrap");
++
++ # this one segfaulted under the conditions above
++ # of course, CANY is evil, maybe it should crash
++ ok($s =~ /.\C+/, "CANY pointer wrap");
++ }
+ } # End of sub run_tests
+
+ 1;