We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b2ab0e commit 06c1da1Copy full SHA for 06c1da1
Modules/faulthandler.c
@@ -1329,7 +1329,11 @@ int _PyFaulthandler_Init(void)
1329
* be able to allocate memory on the stack, even on a stack overflow. If it
1330
* fails, ignore the error. */
1331
stack.ss_flags = 0;
1332
- stack.ss_size = SIGSTKSZ;
+ /* bpo-21131: allocate dedicated stack of SIGSTKSZ*2 bytes, instead of just
1333
+ SIGSTKSZ bytes. Calling the previous signal handler in faulthandler
1334
+ signal handler uses more than SIGSTKSZ bytes of stack memory on some
1335
+ platforms. */
1336
+ stack.ss_size = SIGSTKSZ * 2;
1337
stack.ss_sp = PyMem_Malloc(stack.ss_size);
1338
if (stack.ss_sp != NULL) {
1339
err = sigaltstack(&stack, &old_stack);
0 commit comments