Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/perl.git#316f16da493415a6a2d29b6991507e960ca67c11
This commit is contained in:
DistroBaker 2021-02-09 19:57:03 +00:00
parent 2695fd7b44
commit 6f5bd88717
7 changed files with 468 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From ab72b7bd043df0f0ad6090a4c95f378624fad9fc Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Sat, 7 Mar 2020 12:54:19 -0700
Subject: [PATCH] DynaLoader: use PerlEnv_getenv()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Doing so invokes thread-safe guards
Petr Písař: Ported from b0312014d6c1804920d2b687a5fa5645b445ce9f to
5.32.1.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
ext/DynaLoader/dlutils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ext/DynaLoader/dlutils.c b/ext/DynaLoader/dlutils.c
index 8584f89..1a27fbd 100644
--- a/ext/DynaLoader/dlutils.c
+++ b/ext/DynaLoader/dlutils.c
@@ -115,7 +115,7 @@ dl_generic_private_init(pTHX) /* called by dl_*.xs dl_private_init() */
#endif
#if defined(PERL_IN_DL_HPUX_XS) || defined(PERL_IN_DL_DLOPEN_XS)
- if ( (perl_dl_nonlazy = getenv("PERL_DL_NONLAZY")) != NULL
+ if ( (perl_dl_nonlazy = PerlEnv_getenv("PERL_DL_NONLAZY")) != NULL
&& grok_atoUV(perl_dl_nonlazy, &uv, NULL)
&& uv <= INT_MAX
) {
--
2.26.2

View File

@ -0,0 +1,32 @@
From 9289d4dc7a3d24b20c6e25045e687321ee3e8faf Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Mon, 30 Nov 2020 09:25:52 -0700
Subject: [PATCH] locale.c: Fix typo in #ifdef
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This misspelling led to the code assuming that the platform didn't have
a feature that, if used, would result in faster execution.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
locale.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/locale.c b/locale.c
index 9500ab7960..5970423404 100644
--- a/locale.c
+++ b/locale.c
@@ -2621,7 +2621,7 @@ S_my_nl_langinfo(const int item, bool toggle)
#if defined(HAS_NL_LANGINFO) /* nl_langinfo() is available. */
# if ! defined(HAS_THREAD_SAFE_NL_LANGINFO_L) \
|| ! defined(HAS_POSIX_2008_LOCALE) \
- || ! defined(DUPLOCALE)
+ || ! defined(HAS_DUPLOCALE)
/* Here, use plain nl_langinfo(), switching to the underlying LC_NUMERIC
* for those items dependent on it. This must be copied to a buffer before
--
2.26.2

View File

@ -0,0 +1,140 @@
From 4cfbe5474a5c5f852a6dbf0138dc796c2800be93 Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Wed, 30 Dec 2020 05:55:08 -0700
Subject: [PATCH] Fix buggy fc() in Turkish locale
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When Turkish handling was added, fc() wasn't properly updated
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
pp.c | 12 +++++++++---
t/op/lc.t | 23 ++++++++++++++++-------
2 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/pp.c b/pp.c
index 5e1706346d..23cc6c8adb 100644
--- a/pp.c
+++ b/pp.c
@@ -4813,7 +4813,7 @@ PP(pp_fc)
do {
extra++;
- s_peek = (U8 *) memchr(s_peek + 1, 'i',
+ s_peek = (U8 *) memchr(s_peek + 1, 'I',
send - (s_peek + 1));
} while (s_peek != NULL);
}
@@ -4828,8 +4828,14 @@ PP(pp_fc)
+ 1 /* Trailing NUL */ );
d = (U8*)SvPVX(dest) + len;
- *d++ = UTF8_TWO_BYTE_HI(GREEK_SMALL_LETTER_MU);
- *d++ = UTF8_TWO_BYTE_LO(GREEK_SMALL_LETTER_MU);
+ if (*s == 'I') {
+ *d++ = UTF8_TWO_BYTE_HI(LATIN_SMALL_LETTER_DOTLESS_I);
+ *d++ = UTF8_TWO_BYTE_LO(LATIN_SMALL_LETTER_DOTLESS_I);
+ }
+ else {
+ *d++ = UTF8_TWO_BYTE_HI(GREEK_SMALL_LETTER_MU);
+ *d++ = UTF8_TWO_BYTE_LO(GREEK_SMALL_LETTER_MU);
+ }
s++;
for (; s < send; s++) {
diff --git a/t/op/lc.t b/t/op/lc.t
index fce77f3d34..812c41d6b6 100644
--- a/t/op/lc.t
+++ b/t/op/lc.t
@@ -17,7 +17,7 @@ BEGIN {
use feature qw( fc );
-plan tests => 139 + 2 * (4 * 256) + 15;
+plan tests => 139 + 2 * (5 * 256) + 17;
is(lc(undef), "", "lc(undef) is ''");
is(lcfirst(undef), "", "lcfirst(undef) is ''");
@@ -352,13 +352,14 @@ foreach my $turkic (0 .. 1) {
my $locale = ($turkic) ? $turkic_locale : $non_turkic_locale;
SKIP: {
- skip "Can't find a $type UTF-8 locale", 4*256 unless defined $locale;
+ skip "Can't find a $type UTF-8 locale", 5*256 unless defined $locale;
use feature qw( unicode_strings );
no locale;
my @unicode_lc;
+ my @unicode_fc;
my @unicode_uc;
my @unicode_lcfirst;
my @unicode_ucfirst;
@@ -366,6 +367,7 @@ foreach my $turkic (0 .. 1) {
# Get all the values outside of 'locale'
for my $i (0 .. 255) {
push @unicode_lc, lc(chr $i);
+ push @unicode_fc, fc(chr $i);
push @unicode_uc, uc(chr $i);
push @unicode_lcfirst, lcfirst(chr $i);
push @unicode_ucfirst, ucfirst(chr $i);
@@ -373,6 +375,7 @@ foreach my $turkic (0 .. 1) {
if ($turkic) {
$unicode_lc[ord 'I'] = chr 0x131;
+ $unicode_fc[ord 'I'] = chr 0x131;
$unicode_lcfirst[ord 'I'] = chr 0x131;
$unicode_uc[ord 'i'] = chr 0x130;
$unicode_ucfirst[ord 'i'] = chr 0x130;
@@ -384,6 +387,7 @@ foreach my $turkic (0 .. 1) {
for my $i (0 .. 255) {
is(lc(chr $i), $unicode_lc[$i], "In a $type UTF-8 locale, lc(chr $i) is the same as official Unicode");
is(uc(chr $i), $unicode_uc[$i], "In a $type UTF-8 locale, uc(chr $i) is the same as official Unicode");
+ is(fc(chr $i), $unicode_fc[$i], "In a $type UTF-8 locale, fc(chr $i) is the same as official Unicode");
is(lcfirst(chr $i), $unicode_lcfirst[$i], "In a $type UTF-8 locale, lcfirst(chr $i) is the same as official Unicode");
is(ucfirst(chr $i), $unicode_ucfirst[$i], "In a $type UTF-8 locale, ucfirst(chr $i) is the same as official Unicode");
}
@@ -391,27 +395,32 @@ foreach my $turkic (0 .. 1) {
}
SKIP: {
- skip "Can't find a turkic UTF-8 locale", 15 unless defined $turkic_locale;
+ skip "Can't find a turkic UTF-8 locale", 17 unless defined $turkic_locale;
# These are designed to stress the calculation of space needed for the
# strings. $filler contains a variety of characters that have special
# handling in the casing functions, and some regular chars as well.
+ # (0x49 = 'I')
my $filler_length = 10000;
- my $filler = uni_to_native("\x{df}\x{b5}\x{e0}\x{c1}\x{b6}\x{ff}") x $filler_length;
+ my $filler = uni_to_native("\x{df}\x{49}\x{69}\x{b5}\x{e0}\x{c1}\x{b6}\x{ff}") x $filler_length;
# These are the correct answers to what should happen when the given
# casing function is called on $filler;
- my $filler_lc = uni_to_native("\x{df}\x{b5}\x{e0}\x{e1}\x{b6}\x{ff}") x $filler_length;
- my $filler_fc = ("ss" . uni_to_native("\x{b5}\x{e0}\x{e1}\x{b6}\x{ff}")) x $filler_length;
- my $filler_uc = ("SS" . uni_to_native("\x{39c}\x{c0}\x{c1}\x{b6}\x{178}")) x $filler_length;
+ my $filler_lc = uni_to_native("\x{df}\x{131}\x{69}\x{b5}\x{e0}\x{e1}\x{b6}\x{ff}") x $filler_length;
+ my $filler_fc = ("ss" . uni_to_native("\x{131}\x{69}\x{3bc}\x{e0}\x{e1}\x{b6}\x{ff}")) x $filler_length;
+ my $filler_uc = ("SS" . uni_to_native("\x{49}\x{130}\x{39c}\x{c0}\x{c1}\x{b6}\x{178}")) x $filler_length;
use locale;
setlocale(&POSIX::LC_CTYPE, $turkic_locale);
is (lc "IIIIIII$filler", "\x{131}\x{131}\x{131}\x{131}\x{131}\x{131}\x{131}$filler_lc",
"lc non-UTF-8, in Turkic locale, beginning with a bunch of I's");
+ is (fc "IIIIIII$filler", "\x{131}\x{131}\x{131}\x{131}\x{131}\x{131}\x{131}$filler_fc",
+ "fc non-UTF-8, in Turkic locale, beginning with a bunch of I's");
is (lc "${filler}IIIIIII$filler", "$filler_lc\x{131}\x{131}\x{131}\x{131}\x{131}\x{131}\x{131}$filler_lc",
"lc non-UTF-8, in Turkic locale, a bunch of I's, but not at the beginning");
+ is (fc "${filler}IIIIIII$filler", "$filler_fc\x{131}\x{131}\x{131}\x{131}\x{131}\x{131}\x{131}$filler_fc",
+ "fc non-UTF-8, in Turkic locale, a bunch of I's, but not at the beginning");
is (lc "${filler}I\x{307}$filler", "${filler_lc}i$filler_lc",
"lc in Turkic locale with DOT ABOVE immediately following I");
is (lc "${filler}I\x{307}IIIIII$filler", "${filler_lc}i\x{131}\x{131}\x{131}\x{131}\x{131}\x{131}$filler_lc",
--
2.26.2

View File

@ -0,0 +1,43 @@
From 036189b0a003875df7bf09c7f7fd702267f549e5 Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Sat, 26 Dec 2020 08:44:08 -0700
Subject: [PATCH] Use perl.h versions of PERL_UNUSED_foo in XSUB.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This commit was applied to perl.h, but not to XSUB.h:
commit a730e3f230f364cffe49370f816f975ae7c9c403
Author: Jarkko Hietaniemi <jhi@iki.fi>
Date: Thu Sep 4 09:08:33 2014 -0400
Use sizeof() in UNUSED_ARG and UNUSED_VAR to avoid accessing the values.
The values might even be uninitialized in the case of PERL_UNUSED_VAR.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
XSUB.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/XSUB.h b/XSUB.h
index 616d813840..c1e3959885 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -108,10 +108,10 @@ is a lexical C<$_> in scope.
*/
#ifndef PERL_UNUSED_ARG
-# define PERL_UNUSED_ARG(x) ((void)x)
+# define PERL_UNUSED_ARG(x) ((void)sizeof(x))
#endif
#ifndef PERL_UNUSED_VAR
-# define PERL_UNUSED_VAR(x) ((void)x)
+# define PERL_UNUSED_VAR(x) ((void)sizeof(x))
#endif
#define ST(off) PL_stack_base[ax + (off)]
--
2.26.2

View File

@ -0,0 +1,78 @@
From 07319fdbb283f93cb655c3106b5237cbc7272038 Mon Sep 17 00:00:00 2001
From: Tomasz Konojacki <me@xenu.pl>
Date: Wed, 30 Dec 2020 14:03:02 +0100
Subject: [PATCH] op.c: croak on "my $_" when "use utf8" is in effect
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes #18449
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
op.c | 16 +++++++++-------
t/op/mydef.t | 11 +++++++++--
2 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/op.c b/op.c
index b2e12dd0c0..dce844d297 100644
--- a/op.c
+++ b/op.c
@@ -730,6 +730,7 @@ PADOFFSET
Perl_allocmy(pTHX_ const char *const name, const STRLEN len, const U32 flags)
{
PADOFFSET off;
+ bool is_idfirst, is_default;
const bool is_our = (PL_parser->in_my == KEY_our);
PERL_ARGS_ASSERT_ALLOCMY;
@@ -738,14 +739,15 @@ Perl_allocmy(pTHX_ const char *const name, const STRLEN len, const U32 flags)
Perl_croak(aTHX_ "panic: allocmy illegal flag bits 0x%" UVxf,
(UV)flags);
+ is_idfirst = flags & SVf_UTF8
+ ? isIDFIRST_utf8_safe((U8*)name + 1, name + len)
+ : isIDFIRST_A(name[1]);
+
+ /* $_, @_, etc. */
+ is_default = len == 2 && name[1] == '_';
+
/* complain about "my $<special_var>" etc etc */
- if ( len
- && !( is_our
- || isALPHA(name[1])
- || ( (flags & SVf_UTF8)
- && isIDFIRST_utf8_safe((U8 *)name+1, name + len))
- || (name[1] == '_' && len > 2)))
- {
+ if (!is_our && (!is_idfirst || is_default)) {
const char * const type =
PL_parser->in_my == KEY_sigvar ? "subroutine signature" :
PL_parser->in_my == KEY_state ? "\"state\"" : "\"my\"";
diff --git a/t/op/mydef.t b/t/op/mydef.t
index 42a81d9ab0..225ce98e51 100644
--- a/t/op/mydef.t
+++ b/t/op/mydef.t
@@ -6,10 +6,17 @@ BEGIN {
set_up_inc('../lib');
}
-plan tests => 1;
-
use strict;
eval 'my $_';
like $@, qr/^Can't use global \$_ in "my" at /;
+{
+ # using utf8 allows $_ to be declared with 'my'
+ # GH #18449
+ use utf8;
+ eval 'my $_;';
+ like $@, qr/^Can't use global \$_ in "my" at /;
+}
+
+done_testing;
--
2.26.2

View File

@ -0,0 +1,100 @@
From cac138107138a9814b32c4de74426225628f1646 Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Sun, 17 Jan 2021 21:45:20 -0700
Subject: [PATCH] Add missing entries to perldiag; GH #18276
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The ticket mentions yet another message, not addressed in this
commit, "Insecure private-use override". That message is part of a
hook for a so-far unimplemented module, so it actually doesn't ever get
raised.
Committer: One correction per Grinnz comment in
https://github.com/Perl/perl5/pull/18491
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
pod/perldiag.pod | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 9c91630d39..63f57f220e 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -2195,6 +2195,20 @@ single form when it must operate on them directly. Either you've passed
an invalid file specification to Perl, or you've found a case the
conversion routines don't handle. Drat.
+=item Error %s in expansion of %s
+
+(F) An error was encountered in handling a user-defined property
+(L<perlunicode/User-Defined Character Properties>). These are
+programmer written subroutines, hence subject to errors that may
+prevent them from compiling or running. The calls to these subs are
+C<eval>'d, and if there is a failure, this message is raised, using the
+contents of C<$@> from the failed C<eval>.
+
+Another possibility is that tainted data was encountered somewhere in
+the chain of expanding the property. If so, the message wording will
+indicate that this is the problem. See L</Insecure user-defined
+property %s>.
+
=item Eval-group in insecure regular expression
(F) Perl detected tainted data when trying to compile a regular
@@ -2836,6 +2850,16 @@ not match 8 spaces.
text. You should check the pattern to ensure that recursive patterns
either consume text or fail.
+=item Infinite recursion in user-defined property
+
+(F) A user-defined property (L<perlunicode/User-Defined Character
+Properties>) can depend on the definitions of other user-defined
+properties. If the chain of dependencies leads back to this property,
+infinite recursion would occur, were it not for the check that raised
+this error.
+
+Restructure your property definitions to avoid this.
+
=item Infinite recursion via empty pattern
(F) You tried to use the empty pattern inside of a regex code block,
@@ -6273,6 +6297,20 @@ lexicals that are initialized only once (see L<feature>):
This use of C<my()> in a false conditional was deprecated beginning in
Perl 5.10 and became a fatal error in Perl 5.30.
+=item Timeout waiting for another thread to define \p{%s}
+
+(F) The first time a user-defined property
+(L<perlunicode/User-Defined Character Properties>) is used, its
+definition is looked up and converted into an internal form for more
+efficient handling in subsequent uses. There could be a race if two or
+more threads tried to do this processing nearly simultaneously.
+Instead, a critical section is created around this task, locking out all
+but one thread from doing it. This message indicates that the thread
+that is doing the conversion is taking an unexpectedly long time. The
+timeout exists solely to prevent deadlock; it's long enough that the
+system was likely thrashing and about to crash. There is no real remedy but
+rebooting.
+
=item times not implemented
(F) Your version of the C library apparently doesn't do times(). I
@@ -6846,6 +6884,13 @@ for the list of known options.
L<perlrun|perlrun/-C [numberE<sol>list]> documentation of the C<-C> switch
for the list of known options.
+=item Unknown user-defined property name \p{%s}
+
+(F) You specified to use a property within the C<\p{...}> which was a
+syntactically valid user-defined property, but no definition was found
+for it by the time one was required to proceed. Check your spelling.
+See L<perlunicode/User-Defined Character Properties>.
+
=item Unknown verb pattern '%s' in regex; marked by S<<-- HERE> in m/%s/
(F) You either made a typo or have incorrectly put a C<*> quantifier
--
2.26.2

View File

@ -100,7 +100,7 @@ License: GPL+ or Artistic
Epoch: %{perl_epoch}
Version: %{perl_version}
# release number must be even higher, because dual-lived modules will be broken otherwise
Release: 470%{?dist}
Release: 471%{?dist}
Summary: Practical Extraction and Report Language
Url: https://www.perl.org/
Source0: https://www.cpan.org/src/5.0/perl-%{perl_version}.tar.xz
@ -241,6 +241,26 @@ Patch45: perl-5.33.2-Remove-Perl_av_top_index.patch
Patch46: perl-5.32.0-pp_split-no-SWITCHSTACK-in-ary-split-.-optimisation.patch
Patch47: perl-5.33.3-pp_split-add-TonyC-s-stack-not-refcounted-suggestion.patch
# Make accessing environment by DynaLoader thread-safe,
# in upstream after 5.33.4
Patch48: perl-5.32.1-DynaLoader-use-PerlEnv_getenv.patch
# Use duplocale() if available, in upstream after 5.33.4
Patch49: perl-5.33.4-locale.c-Fix-typo-in-ifdef.patch
# Fix fc() in Turkish locale, in upstream after 5.33.5
Patch50: perl-5.33.5-Fix-buggy-fc-in-Turkish-locale.patch
# Fix croaking on "my $_" when "use utf8" is in effect, GH#18449,
# in upstream after 5.33.5
Patch51: perl-5.33.5-op.c-croak-on-my-_-when-use-utf8-is-in-effect.patch
# Fix PERL_UNUSED_ARG() definition in XSUB.h, in upstream after 5.33.5
Patch52: perl-5.33.5-Use-perl.h-versions-of-PERL_UNUSED_foo-in-XSUB.h.patch
# Add missing entries to perldiag, GH#18276, in upstream after 5.33.6
Patch53: perl-5.33.6-Add-missing-entries-to-perldiag-GH-18276.patch
# Link XS modules to libperl.so with EU::CBuilder on Linux, bug #960048
Patch200: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch
@ -4289,6 +4309,12 @@ you're not running VMS, this module does nothing.
%patch45 -p1
%patch46 -p1
%patch47 -p1
%patch48 -p1
%patch49 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1
%patch53 -p1
%patch200 -p1
%patch201 -p1
@ -4335,6 +4361,12 @@ perl -x patchlevel.h \
'Fedora Patch45: Fix a crash in optimizing split() (GH#18232)' \
'Fedora Patch46: Fix a crash in optimizing split() (GH#18232)' \
'Fedora Patch47: Fix a crash in optimizing split() (GH#18232)' \
'Fedora Patch48: Make accessing environment by DynaLoader thread-safe' \
'Fedora Patch49: Use duplocale() if available' \
'Fedora Patch50: Fix fc() in Turkish locale' \
'Fedora Patch51: Fix croaking on "my $_" when "use utf8" is in effect (GH#18449)' \
'Fedora Patch52: Fix PERL_UNUSED_ARG() definition in XSUB.h' \
'Fedora Patch53: Add missing entries to perldiag (GH#18276)' \
'Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on Linux' \
'Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux' \
%{nil}
@ -7062,6 +7094,14 @@ popd
# Old changelog entries are preserved in CVS.
%changelog
* Tue Feb 09 2021 Petr Pisar <ppisar@redhat.com> - 4:5.32.1-471
- Make accessing environment by DynaLoader thread-safe
- Use duplocale() if available
- Fix fc() in Turkish locale
- Fix croaking on "my $_" when "use utf8" is in effect (GH#18449)
- Fix PERL_UNUSED_ARG() definition in XSUB.h
- Add missing entries to perldiag (GH#18276)
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4:5.32.1-470
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild