From c38e1c6cd8e76f9d81d6a92198f35d82d8b6cb20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Tue, 9 Feb 2021 17:52:45 +0100 Subject: [PATCH] Make accessing environment by DynaLoader thread-safe --- ...5.32.1-DynaLoader-use-PerlEnv_getenv.patch | 34 +++++++++++++++++++ perl.spec | 11 +++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 perl-5.32.1-DynaLoader-use-PerlEnv_getenv.patch diff --git a/perl-5.32.1-DynaLoader-use-PerlEnv_getenv.patch b/perl-5.32.1-DynaLoader-use-PerlEnv_getenv.patch new file mode 100644 index 0000000..c07fab9 --- /dev/null +++ b/perl-5.32.1-DynaLoader-use-PerlEnv_getenv.patch @@ -0,0 +1,34 @@ +From ab72b7bd043df0f0ad6090a4c95f378624fad9fc Mon Sep 17 00:00:00 2001 +From: Karl Williamson +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ř +--- + 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 + diff --git a/perl.spec b/perl.spec index 862b510..64f703a 100644 --- a/perl.spec +++ b/perl.spec @@ -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,10 @@ 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 + # 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 +4293,7 @@ you're not running VMS, this module does nothing. %patch45 -p1 %patch46 -p1 %patch47 -p1 +%patch48 -p1 %patch200 -p1 %patch201 -p1 @@ -4335,6 +4340,7 @@ 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 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 +7068,9 @@ popd # Old changelog entries are preserved in CVS. %changelog +* Tue Feb 09 2021 Petr Pisar - 4:5.32.1-471 +- Make accessing environment by DynaLoader thread-safe + * Tue Jan 26 2021 Fedora Release Engineering - 4:5.32.1-470 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild