From: Victor Stinner Date: Tue, 9 Dec 2025 15:25:46 +0000 (+0100) Subject: gh-140222: Increase stack margin on debug build (#142452) X-Git-Tag: v3.15.0a3~142 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49207a522627718a19886386ec2a7ce957437d08;p=thirdparty%2FPython%2Fcpython.git gh-140222: Increase stack margin on debug build (#142452) Increase _PyOS_MIN_STACK_SIZE if Python is built in debug mode. --- diff --git a/Include/internal/pycore_pythonrun.h b/Include/internal/pycore_pythonrun.h index 04a557e12040..2a544edc431e 100644 --- a/Include/internal/pycore_pythonrun.h +++ b/Include/internal/pycore_pythonrun.h @@ -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