Remove a fix for un undefined C behavior in NULL pointer arithmetics
The fix (upstream 8c165a32) changed perl ABI. This command segfaults: $ perl -MJSON::XS -e 'JSON::XS::decode_json(q{plain text})' It broke emmitting warnings from an XS module that was built before applying the fix. Removal of the patch also changes libperl.so's ABI because it removes PL_WARN_ALL and PL_WARN_NONE symbols. XS modules built after the removal will fail to link at run-time. We will rebuild them.
This commit is contained in:
parent
67cee652e7
commit
b8a8e56863
|
@ -1,83 +0,0 @@
|
||||||
From 8c165a32b7cc4f2a147a37c920a96f1b09b2386d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Karl Williamson <khw@cpan.org>
|
|
||||||
Date: Sun, 30 Dec 2018 21:29:07 -0700
|
|
||||||
Subject: [PATCH] regen/warnings.pl: Fix undefined C behavior
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
This fixes compiler warnings "performing pointer arithmetic on a null
|
|
||||||
pointer has undefined behavior"
|
|
||||||
|
|
||||||
There are several ways to fix this. This one was suggested by
|
|
||||||
Tomasz Konojacki++. Instead of trying to point to address 1 and 2, two
|
|
||||||
variables are created, and we point to them. const is cast away.
|
|
||||||
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
|
||||||
globvar.sym | 2 ++
|
|
||||||
perl.h | 5 +++++
|
|
||||||
regen/warnings.pl | 4 ++--
|
|
||||||
warnings.h | 4 ++--
|
|
||||||
4 files changed, 11 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/globvar.sym b/globvar.sym
|
|
||||||
index 6fb387ca0a..476f4ca095 100644
|
|
||||||
--- a/globvar.sym
|
|
||||||
+++ b/globvar.sym
|
|
||||||
@@ -83,4 +83,6 @@ PL_warn_nl
|
|
||||||
PL_warn_nosemi
|
|
||||||
PL_warn_reserved
|
|
||||||
PL_warn_uninit
|
|
||||||
+PL_WARN_ALL
|
|
||||||
+PL_WARN_NONE
|
|
||||||
PL_watch_pvx
|
|
||||||
diff --git a/perl.h b/perl.h
|
|
||||||
index 43b42a8aa5..dd66b120af 100644
|
|
||||||
--- a/perl.h
|
|
||||||
+++ b/perl.h
|
|
||||||
@@ -4454,6 +4454,11 @@ EXTCONST char PL_Zero[]
|
|
||||||
EXTCONST char PL_hexdigit[]
|
|
||||||
INIT("0123456789abcdef0123456789ABCDEF");
|
|
||||||
|
|
||||||
+EXTCONST STRLEN PL_WARN_ALL
|
|
||||||
+ INIT(0);
|
|
||||||
+EXTCONST STRLEN PL_WARN_NONE
|
|
||||||
+ INIT(0);
|
|
||||||
+
|
|
||||||
/* This is constant on most architectures, a global on OS/2 */
|
|
||||||
#ifndef OS2
|
|
||||||
EXTCONST char PL_sh_path[]
|
|
||||||
diff --git a/regen/warnings.pl b/regen/warnings.pl
|
|
||||||
index 9c01e6762f..d244160b3e 100644
|
|
||||||
--- a/regen/warnings.pl
|
|
||||||
+++ b/regen/warnings.pl
|
|
||||||
@@ -322,8 +322,8 @@ my ($index, $warn_size);
|
|
||||||
#define G_WARN_ALL_MASK (G_WARN_ALL_ON|G_WARN_ALL_OFF)
|
|
||||||
|
|
||||||
#define pWARN_STD NULL
|
|
||||||
-#define pWARN_ALL (((STRLEN*)0)+1) /* use warnings 'all' */
|
|
||||||
-#define pWARN_NONE (((STRLEN*)0)+2) /* no warnings 'all' */
|
|
||||||
+#define pWARN_ALL (STRLEN *) &PL_WARN_ALL /* use warnings 'all' */
|
|
||||||
+#define pWARN_NONE (STRLEN *) &PL_WARN_NONE /* no warnings 'all' */
|
|
||||||
|
|
||||||
#define specialWARN(x) ((x) == pWARN_STD || (x) == pWARN_ALL || \
|
|
||||||
(x) == pWARN_NONE)
|
|
||||||
diff --git a/warnings.h b/warnings.h
|
|
||||||
index e0c12ed403..58f52272de 100644
|
|
||||||
--- a/warnings.h
|
|
||||||
+++ b/warnings.h
|
|
||||||
@@ -18,8 +18,8 @@
|
|
||||||
#define G_WARN_ALL_MASK (G_WARN_ALL_ON|G_WARN_ALL_OFF)
|
|
||||||
|
|
||||||
#define pWARN_STD NULL
|
|
||||||
-#define pWARN_ALL (((STRLEN*)0)+1) /* use warnings 'all' */
|
|
||||||
-#define pWARN_NONE (((STRLEN*)0)+2) /* no warnings 'all' */
|
|
||||||
+#define pWARN_ALL (STRLEN *) &PL_WARN_ALL /* use warnings 'all' */
|
|
||||||
+#define pWARN_NONE (STRLEN *) &PL_WARN_NONE /* no warnings 'all' */
|
|
||||||
|
|
||||||
#define specialWARN(x) ((x) == pWARN_STD || (x) == pWARN_ALL || \
|
|
||||||
(x) == pWARN_NONE)
|
|
||||||
--
|
|
||||||
2.17.2
|
|
||||||
|
|
12
perl.spec
12
perl.spec
|
@ -83,7 +83,7 @@ License: GPL+ or Artistic
|
||||||
Epoch: %{perl_epoch}
|
Epoch: %{perl_epoch}
|
||||||
Version: %{perl_version}
|
Version: %{perl_version}
|
||||||
# release number must be even higher, because dual-lived modules will be broken otherwise
|
# release number must be even higher, because dual-lived modules will be broken otherwise
|
||||||
Release: 430%{?dist}
|
Release: 431%{?dist}
|
||||||
Summary: Practical Extraction and Report Language
|
Summary: Practical Extraction and Report Language
|
||||||
Url: https://www.perl.org/
|
Url: https://www.perl.org/
|
||||||
Source0: https://www.cpan.org/src/5.0/perl-%{perl_version}.tar.xz
|
Source0: https://www.cpan.org/src/5.0/perl-%{perl_version}.tar.xz
|
||||||
|
@ -235,10 +235,6 @@ Patch46: perl-5.29.6-First-eof-should-return-true.patch
|
||||||
# Fix a crash when compiling a malformed form, RT#132158, in upstream after 5.29.6
|
# Fix a crash when compiling a malformed form, RT#132158, in upstream after 5.29.6
|
||||||
Patch47: perl-5.29.6-perl-132158-abort-compilation-if-we-see-an-error-com.patch
|
Patch47: perl-5.29.6-perl-132158-abort-compilation-if-we-see-an-error-com.patch
|
||||||
|
|
||||||
# Fix un undefined C behavior in NULL pointer arithmetics, RT#133223,
|
|
||||||
# in upstream after 5.29.6
|
|
||||||
Patch48: perl-5.29.6-regen-warnings.pl-Fix-undefined-C-behavior.patch
|
|
||||||
|
|
||||||
# Prevent long jumps from clobbering local variables, RT#133575,
|
# Prevent long jumps from clobbering local variables, RT#133575,
|
||||||
# in upstream after 5.29.6
|
# in upstream after 5.29.6
|
||||||
Patch49: perl-5.29.6-perl-133575-prevent-set-longjmp-clobbering-locals-in.patch
|
Patch49: perl-5.29.6-perl-133575-prevent-set-longjmp-clobbering-locals-in.patch
|
||||||
|
@ -2852,7 +2848,6 @@ Perl extension for Version Objects
|
||||||
%patch45 -p1
|
%patch45 -p1
|
||||||
%patch46 -p1
|
%patch46 -p1
|
||||||
%patch47 -p1
|
%patch47 -p1
|
||||||
%patch48 -p1
|
|
||||||
%patch49 -p1
|
%patch49 -p1
|
||||||
%patch50 -p1
|
%patch50 -p1
|
||||||
%patch51 -p1
|
%patch51 -p1
|
||||||
|
@ -2897,7 +2892,6 @@ perl -x patchlevel.h \
|
||||||
'Fedora Patch44: Fix reporting a line number for non-terminated prototypes (RT#133524)' \
|
'Fedora Patch44: Fix reporting a line number for non-terminated prototypes (RT#133524)' \
|
||||||
'Fedora Patch45: Fix first eof() return value (RT#133721)' \
|
'Fedora Patch45: Fix first eof() return value (RT#133721)' \
|
||||||
'Fedora Patch47: Fix a crash when compiling a malformed form (RT#132158)' \
|
'Fedora Patch47: Fix a crash when compiling a malformed form (RT#132158)' \
|
||||||
'Fedora Patch48: Fix un undefined C behavior in NULL pointer arithmetics (RT#133223)' \
|
|
||||||
'Fedora Patch49: Prevent long jumps from clobbering local variables (RT#133575)' \
|
'Fedora Patch49: Prevent long jumps from clobbering local variables (RT#133575)' \
|
||||||
'Fedora Patch50: Fix a mismatch with a case-insesitive regular expression on a text with ligatures (RT#133756)' \
|
'Fedora Patch50: Fix a mismatch with a case-insesitive regular expression on a text with ligatures (RT#133756)' \
|
||||||
'Fedora Patch51: Fix the interpreter path if procfs is not mounted (RT#133573)' \
|
'Fedora Patch51: Fix the interpreter path if procfs is not mounted (RT#133573)' \
|
||||||
|
@ -5189,6 +5183,10 @@ popd
|
||||||
|
|
||||||
# Old changelog entries are preserved in CVS.
|
# Old changelog entries are preserved in CVS.
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jan 16 2019 Petr Pisar <ppisar@redhat.com> - 4:5.28.1-431
|
||||||
|
- Remove a fix for un undefined C behavior in NULL pointer arithmetics
|
||||||
|
(RT#133223) because it changes perl ABI
|
||||||
|
|
||||||
* Mon Jan 14 2019 Petr Pisar <ppisar@redhat.com> - 4:5.28.1-430
|
* Mon Jan 14 2019 Petr Pisar <ppisar@redhat.com> - 4:5.28.1-430
|
||||||
- Adjust tests to gdbm-1.15 using an upstream fix (RT#133295)
|
- Adjust tests to gdbm-1.15 using an upstream fix (RT#133295)
|
||||||
- Do not close an IPC pipe that already has a desired descriptor (RT#133726)
|
- Do not close an IPC pipe that already has a desired descriptor (RT#133726)
|
||||||
|
|
Loading…
Reference in New Issue