Lines Matching refs:stack
22 /* Using an alternative stack requires sigaltstack()
33 /* Allocate at maximum 100 MiB of the stack to raise the stack overflow */
138 static stack_t stack;
428 case EXCEPTION_STACK_OVERFLOW: PUTS(fd, "stack overflow"); break;
459 if (stack.ss_sp != NULL) {
462 /* Allocate an alternate stack for faulthandler() signal handler
463 to be able to execute a signal handler on a stack overflow error */
464 stack.ss_sp = PyMem_Malloc(stack.ss_size);
465 if (stack.ss_sp == NULL) {
470 int err = sigaltstack(&stack, &old_stack);
472 /* Release the stack to retry sigaltstack() next time */
473 PyMem_Free(stack.ss_sp);
474 stack.ss_sp = NULL;
514 assert(stack.ss_sp != NULL);
515 /* Call the signal handler on an alternate signal stack
829 assert(stack.ss_sp != NULL);
830 /* Call the signal handler on an alternate signal stack
1158 /* Allocate (at least) 4096 bytes on the stack at each call.
1202 "unable to raise a stack overflow (allocated %zu bytes "
1203 "on the stack, %zu recursive calls)",
1290 PyDoc_STR("_stack_overflow(): recursive call to raise a stack overflow")},
1372 memset(&stack, 0, sizeof(stack));
1373 stack.ss_flags = 0;
1374 /* bpo-21131: allocate dedicated stack of SIGSTKSZ*2 bytes, instead of just
1376 signal handler uses more than SIGSTKSZ bytes of stack memory on some
1378 stack.ss_size = SIGSTKSZ * 2;
1380 /* bpo-46968: Query Linux for minimal stack size to ensure signal delivery
1385 stack.ss_size = SIGSTKSZ + at_minstack_size;
1429 if (stack.ss_sp != NULL) {
1430 /* Fetch the current alt stack */
1434 if (current_stack.ss_sp == stack.ss_sp) {
1435 /* The current alt stack is the one that we installed.
1436 It is safe to restore the old stack that we found when
1440 /* Someone switched to a different alt stack and didn't
1445 PyMem_Free(stack.ss_sp);
1446 stack.ss_sp = NULL;