]> granicus.if.org Git - python/commitdiff
Fix for issue #7085
authorRonald Oussoren <ronaldoussoren@mac.com>
Thu, 19 Nov 2009 16:25:21 +0000 (16:25 +0000)
committerRonald Oussoren <ronaldoussoren@mac.com>
Thu, 19 Nov 2009 16:25:21 +0000 (16:25 +0000)
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.

Misc/NEWS
configure
configure.in

index 4616da8db0a4fe9d374b63e828e9cb2e0f882eeb..fcda7fde16b9310035f06fa1f0318fd85660cea1 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@ What's New in Python 2.7 alpha 1
 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
index 367c87996b016457ffdcf38791f27d274047a031..4df297a474e804aaff9fd626c24e2bb26e76c049 100755 (executable)
--- 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 @@ else
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 
 
@@ -5413,7 +5413,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 else
   ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 
@@ -5434,7 +5434,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 else
   ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 
@@ -6532,7 +6532,7 @@ _ACEOF
 
 
 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 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 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 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 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 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   $EGREP "yes" >/dev/null 2>&1; then
   ipv6type=$i
 fi
-rm -f conftest*
+rm -f -r conftest*
 
                        ;;
                kame)
@@ -17359,7 +17359,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
                                ipv6libdir=/usr/local/v6/lib
                                ipv6trylibc=yes
 fi
-rm -f conftest*
+rm -f -r conftest*
 
                        ;;
                linux-glibc)
@@ -17380,7 +17380,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   ipv6type=$i;
                                ipv6trylibc=yes
 fi
-rm -f conftest*
+rm -f -r conftest*
 
                        ;;
                linux-inet6)
@@ -17418,7 +17418,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
                                ipv6lib=inet6;
                                ipv6libdir=/usr/local/v6/lib
 fi
-rm -f conftest*
+rm -f -r conftest*
 
                        ;;
                v6d)
@@ -17441,7 +17441,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
                                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 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
                                ipv6lib=inet6;
                                ipv6libdir=/usr/local/v6/lib
 fi
-rm -f conftest*
+rm -f -r conftest*
 
                        ;;
                esac
@@ -25744,7 +25744,7 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 fi
-rm -f conftest*
+rm -f -r conftest*
 
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -25763,7 +25763,7 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 
@@ -26033,7 +26033,7 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 
@@ -27111,6 +27111,11 @@ _ACEOF
 
 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; }
index fe8bb2bd6ff8c7f0598d691db66623b3a1967701..c3a167847a68a706c258094abf2449ec5c56867d 100644 (file)
@@ -3999,6 +3999,11 @@ then
   [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([