You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make asyncio debug offsets reachable from _PyRuntime and give them a cookie, version and size #160107
I work on Datadog's Python profiler. I used AI to help write this and have reviewed it.
Proposal
Make the asyncio debug offsets reachable from _PyRuntime, and give them a header like _Py_DebugOffsets has:
Add void *asyncio_debug_offsets to _PyRuntimeState and publish its offset in _Py_DebugOffsets.runtime_state. _asyncio sets it during module init; NULL means _asyncio isn't initialized yet.
Start the asyncio table with a cookie, PY_VERSION_HEX and its size.
_remote_debugging follows the pointer and checks the header. Keep the AsyncioDebug section for existing tools.
This changes both table layouts, so it's 3.16-only.
Why
Discovery._Py_DebugOffsets sits at the start of _PyRuntime, which is exported. Nothing points to the asyncio table and _Py_AsyncioDebug isn't exported, so readers search loaded files by name for the AsyncioDebug section and parse ELF/Mach-O/PE headers from disk. The name filter already had to change once (_asyncio.cpython in 3.14, python after build _asyncio module as static module #136669).
Validation. The table has no cookie, version or size. _remote_debugging checks the cookie of each PyRuntime candidate, but takes the first AsyncioDebug section it finds.
How it would be used
_remote_debugging, and in-process samplers such as DataDog/dd-trace-py#19802, would read the pointer from _PyRuntime, check the header, and then read the table, with no section search.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
@taegyunkim please don't open PRs until we agree on a solution. Until we agree on something the PR doesn't help as we can all prompt our agents to experiment.
9. @taegyunkim please don't open PRs until we agree on a solution. Until we agree on something the PR doesn't help as we can all prompt our agents to experiment.
Yep, that was my mistake as noted in the PR, and thanks for closing it
Also please avoid opening these super verbose AI issues there are very noisy and we need to do quite a lot of effort to cut through the ai noise
I tried it to be more thorough but I'll make sure it's to the point so you can spend less time on it. And trimmed it to the point. Hope this helps.
Activity
pythongh-160107: Make AsyncioDebug reachable from _PyRuntime and add …
kumaraditya303 commentedon Oct 28, 2026
cc @pablogsal
pablogsal commentedon Oct 28, 2026
Will take a look at this this week
pablogsal commentedon Oct 28, 2026
@taegyunkim please don't open PRs until we agree on a solution. Until we agree on something the PR doesn't help as we can all prompt our agents to experiment.
pablogsal commentedon Oct 28, 2026
Also please avoid opening these super verbose AI issues there are very noisy and we need to do quite a lot of effort to cut through the ai noise
taegyunkim commentedon Oct 28, 2026
Yep, that was my mistake as noted in the PR, and thanks for closing it
I tried it to be more thorough but I'll make sure it's to the point so you can spend less time on it. And trimmed it to the point. Hope this helps.
Thanks for taking a look