@@ -1325,7 +1325,11 @@ _PyFaulthandler_Init(int enable) |
|
|
1325 |
1325 |
* be able to allocate memory on the stack, even on a stack overflow. If it |
1326 |
1326 |
* fails, ignore the error. */ |
1327 |
1327 |
stack.ss_flags = 0; |
1328 |
|
-stack.ss_size = SIGSTKSZ; |
|
1328 |
+/* bpo-21131: allocate dedicated stack of SIGSTKSZ*2 bytes, instead of just |
|
1329 |
+ SIGSTKSZ bytes. Calling the previous signal handler in faulthandler |
|
1330 |
+ signal handler uses more than SIGSTKSZ bytes of stack memory on some |
|
1331 |
+ platforms. */ |
|
1332 |
+stack.ss_size = SIGSTKSZ * 2; |
1329 |
1333 |
stack.ss_sp = PyMem_Malloc(stack.ss_size); |
1330 |
1334 |
if (stack.ss_sp != NULL) { |
1331 |
1335 |
err = sigaltstack(&stack, &old_stack); |