Skip to content

_remote_debugging: No frame limit in get_async_stack_trace() #153364

Description

@maurycy

Bug report

Bug description:

We've got it in process_frame_chain():

constsize_tMAX_FRAMES=1024+512;
size_tframe_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_tnext_frame_addr=0;
uintptr_tstackpointer=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(

parse_async_frame_chain(

process_thread_for_async_stack_trace(

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions