Fix for issue #7085
On MacOSX 10.6 the CoreFoundation framework must be initialized on the main
thread, the constructor function in that framework will cause an SIGABRT when
it is called on any other thread.
Because a number of extension link (indirectly) to CoreFoundation and the
Python core itself didn't the interpreter crashed when importing some
extensions, such as _locale, on a secondary thread.
This fix ensures that Python is linked to CoreFoundation on OSX, which results
in the CoreFoundation constructor being called when Python is loaded. This
does not require code changes.
diff --git a/Misc/NEWS b/Misc/NEWS
index 4616da8..fcda7fd 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@
Core and Builtins
-----------------
+- Issue #7085: Fix crash when importing some extensions in a thread
+ on MacOSX 10.6.
+
- Issue #7117: Backport round implementation from Python 3.x. round
now uses David Gay's correctly-rounded string <-> double conversions
(when available), and so produces correctly rounded results. There
diff --git a/configure b/configure
index 367c879..4df297a 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.in Revision: 76300 .
+# From configure.in Revision: 76308 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for python 2.7.
#
@@ -3865,7 +3865,7 @@
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
-rm -f conftest*
+rm -f -r conftest*
@@ -5413,7 +5413,7 @@
else
ac_cv_header_stdc=no
fi
-rm -f conftest*
+rm -f -r conftest*
fi
@@ -5434,7 +5434,7 @@
else
ac_cv_header_stdc=no
fi
-rm -f conftest*
+rm -f -r conftest*
fi
@@ -6532,7 +6532,7 @@
fi
-rm -f conftest*
+rm -f -r conftest*
{ echo "$as_me:$LINENO: result: $was_it_defined" >&5
echo "${ECHO_T}$was_it_defined" >&6; }
@@ -7062,7 +7062,7 @@
else
ac_cv_type_uid_t=no
fi
-rm -f conftest*
+rm -f -r conftest*
fi
{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
@@ -15722,7 +15722,7 @@
else
unistd_defines_pthreads=no
fi
-rm -f conftest*
+rm -f -r conftest*
{ echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5
echo "${ECHO_T}$unistd_defines_pthreads" >&6; }
@@ -17336,7 +17336,7 @@
$EGREP "yes" >/dev/null 2>&1; then
ipv6type=$i
fi
-rm -f conftest*
+rm -f -r conftest*
;;
kame)
@@ -17359,7 +17359,7 @@
ipv6libdir=/usr/local/v6/lib
ipv6trylibc=yes
fi
-rm -f conftest*
+rm -f -r conftest*
;;
linux-glibc)
@@ -17380,7 +17380,7 @@
ipv6type=$i;
ipv6trylibc=yes
fi
-rm -f conftest*
+rm -f -r conftest*
;;
linux-inet6)
@@ -17418,7 +17418,7 @@
ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib
fi
-rm -f conftest*
+rm -f -r conftest*
;;
v6d)
@@ -17441,7 +17441,7 @@
ipv6libdir=/usr/local/v6/lib;
BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"
fi
-rm -f conftest*
+rm -f -r conftest*
;;
zeta)
@@ -17463,7 +17463,7 @@
ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib
fi
-rm -f conftest*
+rm -f -r conftest*
;;
esac
@@ -25744,7 +25744,7 @@
_ACEOF
fi
-rm -f conftest*
+rm -f -r conftest*
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -25763,7 +25763,7 @@
_ACEOF
fi
-rm -f conftest*
+rm -f -r conftest*
fi
@@ -26033,7 +26033,7 @@
_ACEOF
fi
-rm -f conftest*
+rm -f -r conftest*
fi
@@ -27111,6 +27111,11 @@
fi
+if test $ac_sys_system = Darwin
+then
+ LIBS="$LIBS -framework CoreFoundation"
+fi
+
{ echo "$as_me:$LINENO: checking for %zd printf() format support" >&5
echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; }
diff --git a/configure.in b/configure.in
index fe8bb2b..c3a1678 100644
--- a/configure.in
+++ b/configure.in
@@ -3999,6 +3999,11 @@
[Define to printf format modifier for long long type])
fi
+if test $ac_sys_system = Darwin
+then
+ LIBS="$LIBS -framework CoreFoundation"
+fi
+
AC_CACHE_CHECK([for %zd printf() format support], ac_cv_have_size_t_format, [dnl
AC_TRY_RUN([