Title: Make `asyncio` debug offsets reachable from `_PyRuntime` and give them a cookie, version and size · Issue #160107 · python/cpython · GitHub
Open Graph Title: Make `asyncio` debug offsets reachable from `_PyRuntime` and give them a cookie, version and size · Issue #160107 · python/cpython
X Title: Make `asyncio` debug offsets reachable from `_PyRuntime` and give them a cookie, version and size · Issue #160107 · python/cpython
Description: Feature or enhancement 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 ...
Open Graph Description: Feature or enhancement 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 hea...
X Description: Feature or enhancement 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...
Opengraph URL: https://github.com/python/cpython/issues/160107
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make `asyncio` debug offsets reachable from `_PyRuntime` and give them a cookie, version and size","articleBody":"### Feature or enhancement\n\nI work on Datadog's Python profiler. I used AI to help write this and have reviewed it.\n\n#### Proposal\n\nMake the asyncio debug offsets reachable from `_PyRuntime`, and give them a header like `_Py_DebugOffsets` has:\n\n- 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.\n- Start the asyncio table with a cookie, `PY_VERSION_HEX` and its size.\n- `_remote_debugging` follows the pointer and checks the header. Keep the `AsyncioDebug` section for existing tools.\n\nThis changes both table layouts, so it's 3.16-only.\n\n#### Why\n\n1. **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 gh-136669).\n2. **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.\n\n#### How it would be used\n\n`_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.\n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n- gh-91048: added the asyncio debug offsets and the `AsyncioDebug` section\n- gh-148178: validation of the remote debug offset tables\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-160108\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/taegyunkim","@type":"Person","name":"taegyunkim"},"datePublished":"2026-10-21T19:49:37Z","url":"https://github.com/python/cpython/issues/160107"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a0484e02-9728-22f1-d597-f8b8a67849ae |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BE1C:3DA1E8:1A0DD28:2281639:6B021B50 |
| html-safe-nonce | 747d8c2159950f023715a0592394b44741eda48cf06b5ee703f04d42116a8855 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTFDOjNEQTFFODoxQTBERDI4OjIyODE2Mzk6NkIwMjFCNTAiLCJ2aXNpdG9yX2lkIjoiMTIxOTY5NTczOTg4ODAxMzYwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0cd832d3e2a0ee52441328aa0218b72c7439ae7ab448900f73342d79a6bb89dc |
| hovercard-subject-tag | issue:5967444006 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/160107/issue_layout |
| twitter:image | https://opengraph.githubassets.com/591edc76ecdb980a4bb58f38e3b40c40ff0dcce422f674530d5d4573f07978a2/python/cpython/issues/160107 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/591edc76ecdb980a4bb58f38e3b40c40ff0dcce422f674530d5d4573f07978a2/python/cpython/issues/160107 |
| og:image:alt | Feature or enhancement 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 hea... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | taegyunkim |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width