diff --git a/00293-fix-gc-alignment.patch b/00293-fix-gc-alignment.patch new file mode 100644 index 0000000..691b03e --- /dev/null +++ b/00293-fix-gc-alignment.patch @@ -0,0 +1,39 @@ +Fix for over-aligned GC info +Patch by Florian Weimer + +See: https://bugzilla.redhat.com/show_bug.cgi?id=1540316 +Upstream discussion: https://mail.python.org/pipermail/python-dev/2018-January/152000.html + +diff --git a/Include/objimpl.h b/Include/objimpl.h +index 55e83eced6..aa906144dc 100644 +--- a/Include/objimpl.h ++++ b/Include/objimpl.h +@@ -248,6 +248,18 @@ PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t); + /* for source compatibility with 2.2 */ + #define _PyObject_GC_Del PyObject_GC_Del + ++/* Former over-aligned definition of PyGC_Head, used to compute the ++ size of the padding for the new version below. */ ++union _gc_head; ++union _gc_head_old { ++ struct { ++ union _gc_head *gc_next; ++ union _gc_head *gc_prev; ++ Py_ssize_t gc_refs; ++ } gc; ++ long double dummy; ++}; ++ + /* GC information is stored BEFORE the object structure. */ + typedef union _gc_head { + struct { +@@ -255,7 +267,8 @@ typedef union _gc_head { + union _gc_head *gc_prev; + Py_ssize_t gc_refs; + } gc; +- long double dummy; /* force worst-case alignment */ ++ double dummy; /* force worst-case alignment */ ++ char dummy_padding[sizeof(union _gc_head_old)]; + } PyGC_Head; + + extern PyGC_Head *_PyGC_generation0; diff --git a/python2.spec b/python2.spec index 9c922a2..15e8548 100644 --- a/python2.spec +++ b/python2.spec @@ -768,6 +768,10 @@ Patch288: 00288-ambiguous-python-version-rpmbuild-warn.patch # (we handle it it in Setup.dist, see Patch0) Patch289: 00289-disable-nis-detection.patch +# 00293 # +# Fix over-alignment of _gc_head, the structure for GC information +# See https://bugzilla.redhat.com/show_bug.cgi?id=1540316 +Patch293: 00293-fix-gc-alignment.patch # (New patches go here ^^^) # @@ -1094,6 +1098,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c %patch287 -p1 %patch288 -p1 %patch289 -p1 +%patch293 -p1 %if 0%{?_module_build} @@ -1977,6 +1982,7 @@ rm -fr %{buildroot} * Tue Jan 30 2018 Petr Viktorin - 2.7.14-9 - Add patch 288: warn/fail if Python 2 is called as /usr/bin/python and PYTHON_DISALLOW_AMBIGUOUS_VERSION is set +- Add patch 289: Fix for over-aligned GC info * Sat Jan 20 2018 Björn Esser - 2.7.14-8 - Rebuilt for switch to libxcrypt