diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 0a0a62bdf9bfaf..ac4e7a7e0f53b3 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -1049,8 +1049,6 @@ def test_releasing_unacquired_lock(self): lock = threading.Lock() self.assertRaises(RuntimeError, lock.release) - @unittest.skipUnless(sys.platform == 'darwin' and test.support.python_is_optimized(), - 'test macosx problem') def test_recursion_limit(self): # Issue 9670 # test that excessive recursion within a non-main thread causes diff --git a/Misc/NEWS.d/next/macOS/2019-07-13-15-58-18.bpo-18049.MklhQQ.rst b/Misc/NEWS.d/next/macOS/2019-07-13-15-58-18.bpo-18049.MklhQQ.rst new file mode 100644 index 00000000000000..5af07cdb4119f8 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2019-07-13-15-58-18.bpo-18049.MklhQQ.rst @@ -0,0 +1,3 @@ +Increase the default stack size of threads from 5MB to 16MB on macOS, to +match the stack size of the main thread. This avoids crashes on deep recursion +in threads. diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index a36d16c19eade5..994e35b2cc0803 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -40,7 +40,8 @@ */ #if defined(__APPLE__) && defined(THREAD_STACK_SIZE) && THREAD_STACK_SIZE == 0 #undef THREAD_STACK_SIZE -#define THREAD_STACK_SIZE 0x500000 +/* Note: This matches the value of -Wl,-stack_size in configure.ac */ +#define THREAD_STACK_SIZE 0x1000000 #endif #if defined(__FreeBSD__) && defined(THREAD_STACK_SIZE) && THREAD_STACK_SIZE == 0 #undef THREAD_STACK_SIZE diff --git a/configure b/configure index cb5f130d38e051..3cd9b8866c7246 100755 --- a/configure +++ b/configure @@ -9542,6 +9542,8 @@ then # Issue #18075: the default maximum stack size (8MBytes) is too # small for the default recursion limit. Increase the stack size # to ensure that tests don't crash + # Note: This matches the value of THREAD_STACK_SIZE in + # thread_pthread.h LINKFORSHARED="-Wl,-stack_size,1000000 $LINKFORSHARED" if test "$enable_framework" diff --git a/configure.ac b/configure.ac index b31ed242f1a819..a2088897fc139e 100644 --- a/configure.ac +++ b/configure.ac @@ -2694,6 +2694,8 @@ then # Issue #18075: the default maximum stack size (8MBytes) is too # small for the default recursion limit. Increase the stack size # to ensure that tests don't crash + # Note: This matches the value of THREAD_STACK_SIZE in + # thread_pthread.h LINKFORSHARED="-Wl,-stack_size,1000000 $LINKFORSHARED" if test "$enable_framework"
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: