GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — `python -m profiling.sampling --async-aware` shows one frame for a task whose coroutine recurses · Issue #158522 · python/cpython Closed Labels stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-profilingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportA task whose coroutine recurses is shown with only one frame in the profiler dump Repro: import asyncio, os, time async def rec(n): if n: await rec(n - 1) else: print(os.getpid(), flush=True) t0 = time.monotonic() while time.monotonic() - t0 < 30: pass async def main(): await asyncio.create_task(rec(4)) asyncio.run(main()) Run: Actual: Expected: Proposed fix: Stop the frame walk at the task's own frame instead of its code object I have a fix ready CPython versions tested on:CPython main branch Operating systems tested on:macOS Linked PRsActivity
MetadataMetadataAssigneesLabelsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-profilingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue 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. |