Blame SOURCES/00333-fix-faulthandler-stack.patch

dd3773
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
dd3773
index 890c645..ccab553 100644
dd3773
--- a/Modules/faulthandler.c
dd3773
+++ b/Modules/faulthandler.c
dd3773
@@ -1333,7 +1333,11 @@ int _PyFaulthandler_Init(void)
dd3773
      * be able to allocate memory on the stack, even on a stack overflow. If it
dd3773
      * fails, ignore the error. */
dd3773
     stack.ss_flags = 0;
dd3773
-    stack.ss_size = SIGSTKSZ;
dd3773
+    /* bpo-21131: allocate dedicated stack of SIGSTKSZ*2 bytes, instead of just
dd3773
+       SIGSTKSZ bytes. Calling the previous signal handler in faulthandler
dd3773
+       signal handler uses more than SIGSTKSZ bytes of stack memory on some
dd3773
+       platforms. */
dd3773
+    stack.ss_size = SIGSTKSZ * 2;
dd3773
     stack.ss_sp = PyMem_Malloc(stack.ss_size);
dd3773
     if (stack.ss_sp != NULL) {
dd3773
         err = sigaltstack(&stack, &old_stack);