https://github.com/python/cpython/commit/0e89f7abd494bd6c658083c1c1d50a640a1f2309 commit: 0e89f7abd494bd6c658083c1c1d50a640a1f2309 branch: main author: Sam James <[email protected]> committer: vstinner <[email protected]> date: 2024-09-23T09:03:30+02:00 summary:
GH-113655: Lower the C recursion limit for HPPA, PPC64 and SPARC (#124264) Lower the C recursion limit for HPPA, PPC64 and SPARC, as they use relatively large stack frames that cause e.g. `test_descr` to hit a stack overflow. According to quick testing, it seems that values around 8000 are max for HPPA and PPC64 (ELFv1 ABI) and 7000 for SPARC64. To keep things safe, let's use 5000 for PPC64 and 4000 for SPARC. Co-authored-by: Michał Górny <[email protected]> files: M Include/cpython/pystate.h diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h index f005729fff11b6..32f68378ea5d72 100644 --- a/Include/cpython/pystate.h +++ b/Include/cpython/pystate.h @@ -218,9 +218,15 @@ struct _ts { # define Py_C_RECURSION_LIMIT 3000 #elif defined(_Py_ADDRESS_SANITIZER) # define Py_C_RECURSION_LIMIT 4000 +#elif defined(__sparc__) + // test_descr crashed on sparc64 with >7000 but let's keep a margin of error. +# define Py_C_RECURSION_LIMIT 4000 #elif defined(__wasi__) // Based on wasmtime 16. # define Py_C_RECURSION_LIMIT 5000 +#elif defined(__hppa__) || defined(__powerpc64__) + // test_descr crashed with >8000 but let's keep a margin of error. +# define Py_C_RECURSION_LIMIT 5000 #else // This value is duplicated in Lib/test/support/__init__.py # define Py_C_RECURSION_LIMIT 10000 _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
