← Winnitude! Search  ·  Reader Mode (1523 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 13 LINKS

`profiling.sampling dump --async-aware` reports no stacks for cyclic asyncio waits · Issue #163217 · python/cpython

Repository navigation

profiling.sampling dump --async-aware reports no stacks for cyclic asyncio waits  #163217


New issue

New issue

Backlog

Backlog
profiling.sampling dump --async-aware reports no stacks for cyclic asyncio waits #163217 Labels
stdlib

topic-profiling

type-bug

Description

@deadlovelll's profile deadlovelll opened on Dec 5, 2026

Bug report

When asyncio tasks wait on each other dump --async-aware can skip their stacks and print No Python stacks found

import asyncio
import os

async def worker(parent):
    await asyncio.wait([parent], timeout=60)

async def main():
    print(os.getpid(), flush=True)
    await asyncio.create_task(worker(asyncio.current_task()), name="worker")

asyncio.run(main())

Run:

sudo ./python.exe -m profiling.sampling dump --async-aware <PID>

Actual output:

No Python stacks found for PID 40737

It's not true that process doesnt have any stacks. Good example here - asyncio pstree behavior:

ERROR: await-graph contains cycles - cannot print a stack dump!

cycle: worker → Task-1 → worker

Proposed fix: report await cycles as asyncio pstree does

I have a patch ready

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels


    stdlib

    topic-profiling

    type-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions