Bug report
Bug description:
We've got it in process_frame_chain():
|
const size_t MAX_FRAMES = 1024 + 512; |
|
size_t frame_count = 0; |
|
assert(MAX_FRAMES > 0 && MAX_FRAMES < 10000); |
|
|
|
ctx->stopped_at_cached_frame = 0; |
|
ctx->last_frame_visited = 0; |
|
|
|
while ((void*)frame_addr != NULL) { |
|
PyObject *frame = NULL; |
|
uintptr_t next_frame_addr = 0; |
|
uintptr_t stackpointer = 0; |
|
last_frame_addr = frame_addr; |
|
|
|
if (++frame_count > MAX_FRAMES) { |
|
PyErr_SetString(PyExc_RuntimeError, "Too many stack frames (possible infinite loop)"); |
|
set_exception_cause(unwinder, PyExc_RuntimeError, "Frame chain iteration limit exceeded"); |
|
return -1; |
|
} |
|
assert(frame_count <= MAX_FRAMES); |
There's no such limit in parse_async_frame_chain():
|
process_running_task_chain( |
|
process_thread_for_async_stack_trace( |
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
Bug report
Bug description:
We've got it in
process_frame_chain():cpython/Modules/_remote_debugging/frames.c
Lines 308 to 326 in 548c731
There's no such limit in
parse_async_frame_chain():cpython/Modules/_remote_debugging/asyncio.c
Line 937 in c843cb7
cpython/Modules/_remote_debugging/asyncio.c
Line 767 in c843cb7
cpython/Modules/_remote_debugging/asyncio.c
Line 989 in c843cb7
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
get_async_stack_trace()andparse_coro_chain()#153365