]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-140222: Increase stack margin on debug build (#142452)
authorVictor Stinner <vstinner@python.org>
Tue, 9 Dec 2025 15:25:46 +0000 (16:25 +0100)
committerGitHub <noreply@github.com>
Tue, 9 Dec 2025 15:25:46 +0000 (16:25 +0100)
Increase _PyOS_MIN_STACK_SIZE if Python is built in debug mode.

Include/internal/pycore_pythonrun.h

index 04a557e1204064e1485abab7eeb45585a46aa6ab..2a544edc431e6b1396918061389eca1e7dc18a35 100644 (file)
@@ -44,9 +44,9 @@ extern PyObject * _Py_CompileStringObjectWithModule(
  * no two calls to check recursion depth are more than this far
  * apart. In practice, that means it must be larger than the C
  * stack consumption of PyEval_EvalDefault */
-#if defined(_Py_ADDRESS_SANITIZER) || defined(_Py_THREAD_SANITIZER)
-#  define _PyOS_LOG2_STACK_MARGIN 12
-#elif defined(Py_DEBUG) && defined(WIN32)
+#if (defined(Py_DEBUG) \
+     || defined(_Py_ADDRESS_SANITIZER) \
+     || defined(_Py_THREAD_SANITIZER))
 #  define _PyOS_LOG2_STACK_MARGIN 12
 #else
 #  define _PyOS_LOG2_STACK_MARGIN 11