Repository navigation
Commit 10eb693
gh-159879: Do not limit the C stack below what the interpreter assumes
On AIX, NetBSD and non-glibc Linux, hardware_stack_limits() cannot query
the stack of the running thread and the interpreter assumes
Py_C_STACK_SIZE instead. A test thread created with less than that
overflows its stack before the recursion guard notices, so the test
crashes instead of getting RecursionError.
run_with_limited_c_stack() now probes once whether the real size is
visible -- two threads of different sizes report the same headroom only
if the fixed estimate is in use -- and raises a too-small *size* to
C_STACK_SIZE when it is not.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EQFVNrJAem9X2Enn8MSRcV1 parent 036d309 commit 10eb693
2 files changed
Lines changed: 54 additions & 3 deletions
File tree
- Lib/test/support
- Misc/NEWS.d/next/Tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2940 | 2940 | | |
2941 | 2941 | | |
2942 | 2942 | | |
2943 | | - | |
2944 | | - | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
2945 | 2946 | | |
2946 | 2947 | | |
2947 | 2948 | | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
2948 | 2983 | | |
2949 | 2984 | | |
2950 | 2985 | | |
| |||
2954 | 2989 | | |
2955 | 2990 | | |
2956 | 2991 | | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
2957 | 2996 | | |
2958 | 2997 | | |
2959 | 2998 | | |
2960 | 2999 | | |
2961 | 3000 | | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
2962 | 3008 | | |
2963 | 3009 | | |
2964 | 3010 | | |
| |||
2967 | 3013 | | |
2968 | 3014 | | |
2969 | 3015 | | |
2970 | | - | |
| 3016 | + | |
2971 | 3017 | | |
2972 | 3018 | | |
2973 | 3019 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments