]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #14184: Increase the default stack size for secondary threads on
authorNed Deily <nad@acm.org>
Tue, 13 Mar 2012 18:18:18 +0000 (11:18 -0700)
committerNed Deily <nad@acm.org>
Tue, 13 Mar 2012 18:18:18 +0000 (11:18 -0700)
Mac OS X to prevent interpreter crashes when compiled on 10.7.

Misc/NEWS
Python/thread_pthread.h

index 93b5a74cef7cc56f34c50dbc4a725829073cf0c4..295a425b030c3545b6604679a37a94eaae9469c0 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -22,6 +22,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #14184: Increase the default stack size for secondary threads on
+  Mac OS X to avoid interpreter crashes when using threads on 10.7.
+
 - Issue #10543: Fix unittest test discovery with Jython bytecode files.
 
 - Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under
index 3efccf660a50b0e4af0c9ae22fb80c5fc816a8b7..3cde03567c3e9cb700316f55dfa2ad3d4e466683 100644 (file)
 #define THREAD_STACK_SIZE       0       /* use default stack size */
 #endif
 
-#if (defined(__APPLE__) || defined(__FreeBSD__)) && defined(THREAD_STACK_SIZE) && THREAD_STACK_SIZE == 0
-   /* The default stack size for new threads on OSX is small enough that
-    * we'll get hard crashes instead of 'maximum recursion depth exceeded'
-    * exceptions.
-    *
-    * The default stack size below is the minimal stack size where a
-    * simple recursive function doesn't cause a hard crash.
-    */
+/* The default stack size for new threads on OSX and BSD is small enough that
+ * we'll get hard crashes instead of 'maximum recursion depth exceeded'
+ * exceptions.
+ *
+ * The default stack sizes below are the empirically determined minimal stack
+ * sizes where a simple recursive function doesn't cause a hard crash.
+ */
+#if defined(__APPLE__) && defined(THREAD_STACK_SIZE) && THREAD_STACK_SIZE == 0
+#undef  THREAD_STACK_SIZE
+#define THREAD_STACK_SIZE       0x500000
+#endif
+#if defined(__FreeBSD__) && defined(THREAD_STACK_SIZE) && THREAD_STACK_SIZE == 0
 #undef  THREAD_STACK_SIZE
 #define THREAD_STACK_SIZE       0x400000
 #endif