[arch-commits] Commit in python/trunk (2 files)

Evangelos Foutras foutrelis at archlinux.org
Mon Sep 7 12:38:38 UTC 2015


    Date: Monday, September 7, 2015 @ 14:38:38
  Author: foutrelis
Revision: 245451

Fix possible test_faulthandler hang on x86_64

Added:
  python/trunk/fix-undefined-behaviour-in-faulthandler.patch
Modified:
  python/trunk/PKGBUILD

-----------------------------------------------+
 PKGBUILD                                      |    7 +++-
 fix-undefined-behaviour-in-faulthandler.patch |   41 ++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-09-07 10:44:58 UTC (rev 245450)
+++ PKGBUILD	2015-09-07 12:38:38 UTC (rev 245451)
@@ -26,14 +26,19 @@
 provides=('python3')
 replaces=('python3')
 source=(http://www.python.org/ftp/python/${pkgver%rc*}/Python-${pkgver}.tar.xz
+        fix-undefined-behaviour-in-faulthandler.patch
         increase-dh-key-size.patch)
 sha1sums=('7ca5cd664598bea96eec105aa6453223bb6b4456'
+          '26c5bb4fc14d49438fbd99a5aa9a51289b6d3010'
           '924393ee68a39ba4931a49045895db8786b5e178')
 
 prepare() {
   cd Python-${pkgver}
 
-  # http://bugs.python.org/issue23844
+  # https://bugs.python.org/issue23433
+  patch -Np1 -i ../fix-undefined-behaviour-in-faulthandler.patch
+
+  # https://bugs.python.org/issue23844
   patch -Np1 -i ../increase-dh-key-size.patch
 
   # FS#23997

Added: fix-undefined-behaviour-in-faulthandler.patch
===================================================================
--- fix-undefined-behaviour-in-faulthandler.patch	                        (rev 0)
+++ fix-undefined-behaviour-in-faulthandler.patch	2015-09-07 12:38:38 UTC (rev 245451)
@@ -0,0 +1,41 @@
+
+# HG changeset patch
+# User Victor Stinner <victor.stinner at gmail.com>
+# Date 1423661015 -3600
+# Node ID 689092296ad31951f8f919fc06b49450e648e93d
+# Parent  645f3d750be139ce0198e15e221da07b22289a92
+Issue #23433: Fix faulthandler._stack_overflow()
+
+Fix undefined behaviour: don't compare pointers. Use Py_uintptr_t type instead
+of void*. It fixes test_faulthandler on Fedora 22 which now uses GCC 5.
+
+diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
+--- a/Modules/faulthandler.c
++++ b/Modules/faulthandler.c
+@@ -911,12 +911,12 @@ faulthandler_fatal_error_py(PyObject *se
+ }
+ 
+ #if defined(HAVE_SIGALTSTACK) && defined(HAVE_SIGACTION)
+-static void*
+-stack_overflow(void *min_sp, void *max_sp, size_t *depth)
++static Py_uintptr_t
++stack_overflow(Py_uintptr_t min_sp, Py_uintptr_t max_sp, size_t *depth)
+ {
+     /* allocate 4096 bytes on the stack at each call */
+     unsigned char buffer[4096];
+-    void *sp = &buffer;
++    Py_uintptr_t sp = (Py_uintptr_t)&buffer;
+     *depth += 1;
+     if (sp < min_sp || max_sp < sp)
+         return sp;
+@@ -929,7 +929,8 @@ static PyObject *
+ faulthandler_stack_overflow(PyObject *self)
+ {
+     size_t depth, size;
+-    char *sp = (char *)&depth, *stop;
++    Py_uintptr_t sp = (Py_uintptr_t)&depth;
++    Py_uintptr_t stop;
+ 
+     depth = 0;
+     stop = stack_overflow(sp - STACK_OVERFLOW_MAX_SIZE,
+



More information about the arch-commits mailing list