8000 gh-135371: Fix asyncio introspection output to include internal coroutine chains by pablogsal · Pull Request #135436 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-135371: Fix asyncio introspection output to include internal coroutine chains #135436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Small fixes
  • Loading branch information
pablogsal committed Jun 12, 2025
commit 43d33d47d9fcf0fd5bea6c503374f4b627bb5f04
2 changes: 1 addition & 1 deletion Lib/test/test_external_inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
try:
from _remote_debugging import PROCESS_VM_READV_SUPPORTED
from _remote_debugging import RemoteUnwinder
from _remote_debugging import FrameInfo, CoroInfo, TaskInfo, AwaitedInfo
from _remote_debugging import FrameInfo, CoroInfo, TaskInfo
except ImportError:
raise unittest.SkipTest(
"Test only runs when _remote_debugging is available"
Expand Down
7 changes: 3 additions & 4 deletions Modules/_remote_debugging_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,10 +1004,9 @@ create_task_result(
goto error;
}

// PyStructSequence_SetItem steals references, so we don't need to DECREF on success
PyStructSequence_SetItem(result, 0, call_stack); // This steals the reference
PyStructSequence_SetItem(result, 1, tn); // This steals the reference
call_stack = NULL; // Avoid decref since reference was stolen
tn = NULL; // Avoid decref since reference was stolen

return result;

Expand Down Expand Up @@ -1054,14 +1053,12 @@ parse_task(
}
PyObject *empty_list = PyList_New(0);
if (empty_list == NULL) {
Py_DECREF(result);
set_exception_cause(unwinder, PyExc_MemoryError, "Failed to create empty list");
goto error;
}
PyObject *task_name = PyLong_FromUnsignedLongLong(task_address);
if (task_name == NULL) {
7711 Py_DECREF(empty_list);
Py_DECREF(result);
set_exception_cause(unwinder, PyExc_RuntimeError, "Failed to create task name");
goto error;
}
Expand Down Expand Up @@ -1296,6 +1293,8 @@ process_single_task_node(
current_awaited_by = PyStructSequence_GetItem(result_item, 3);
if (parse_task_awaited_by(unwinder, task_addr, current_awaited_by, 0) < 0) {
set_exception_cause(unwinder, PyExc_RuntimeError, "Failed to parse awaited_by in single task node");
// No cleanup needed here since all references were transferred to result_item
// and result_item was already added to result list and decreffed
return -1;
}

Expand Down
Loading
0