GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Make `asyncio` debug offsets reachable from `_PyRuntime` and give them a cookie, version and size · Issue #160107 · python/cpython

Make asyncio debug offsets reachable from _PyRuntime and give them a cookie, version and size #160107

New issue
Copy link
New issue
Copy link
Open
Open
Make asyncio debug offsets reachable from _PyRuntime and give them a cookie, version and size#160107
Copy link
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-featureA feature request or enhancementA feature request or enhancement

Description

@taegyunkim
taegyunkim
opened on Oct 21, 2026
Issue body actions

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 *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

  1. 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).
  2. 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

Links to previous discussion of this feature:

  • Async Call-Stack Reconstruction #91048: added the asyncio debug offsets and the AsyncioDebug section
  • Harden validation of remote debugging offset tables #148178: validation of the remote debug offset tables

Linked PRs

  • gh-160107: Make AsyncioDebug reachable from _PyRuntime and add a header #160108

Activity

  1. taegyunkim
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Oct 21, 2026
  2. taegyunkim
    added a commit that references this issue on Oct 21, 2026

    pythongh-160107: Make AsyncioDebug reachable from _PyRuntime and add …

    cdd4ad0
  3. StanFromIreland
    added
    topic-asyncio
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    on Oct 21, 2026
  4. github-project-automation
    added this to asyncioon Oct 21, 2026
  5. github-project-automation
    moved this to Todo in asyncioon Oct 21, 2026
  6. kumaraditya303 commented on Oct 28, 2026

    @kumaraditya303
    kumaraditya303
    on Oct 28, 2026
    Contributor
    More actions

    cc @pablogsal

    Reacted by Taegyun Kim
  7. pablogsal commented on Oct 28, 2026

    @pablogsal
    pablogsal
    on Oct 28, 2026
    Member
    More actions

    Will take a look at this this week

  8. pablogsal commented on Oct 28, 2026

    @pablogsal
    pablogsal
    on Oct 28, 2026
    Member
    More actions

    @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. pablogsal commented on Oct 28, 2026

    @pablogsal
    pablogsal
    on Oct 28, 2026
    Member
    More actions

    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

  10. taegyunkim commented on Oct 28, 2026

    @taegyunkim
    taegyunkim
    on Oct 28, 2026
    ContributorAuthor
    More actions

    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.

    Thanks for taking a look

    Reacted by Pablo Galindo Salgado
  11. kumaraditya303
    removed
    topic-asyncio
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirC modules in the Modules dirtype-featureA feature request or enhancementA feature request or enhancement

    Projects

    • asyncio
      Status
      Todo
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.