René's URL Explorer Experiment


Title: gh-153364: Make frame, coroutine, and task-waiter chain walks iterative and bounded by maurycy · Pull Request #153365 · python/cpython · GitHub

Open Graph Title: gh-153364: Make frame, coroutine, and task-waiter chain walks iterative and bounded by maurycy · Pull Request #153365 · python/cpython

X Title: gh-153364: Make frame, coroutine, and task-waiter chain walks iterative and bounded by maurycy · Pull Request #153365 · python/cpython

Description: The PR hardens and cleans up frame, coro and task-waiter walks a bit, by making them iterative and bounded. I'm addressing two issues here: No walk limits. The walks use pointers read from the target without any guarantees, so a torn read could stitch a cycle. Not to mention adversial targets. process_frame_chain() already had 1024 + 512 limit, but the PR extracts it as MAX_FRAME_CHAIN_DEPTH and applies in the parse_coro_chain(), used by both sync and async paths, and parse_async_frame_chain(). The task-waiter walk in get_async_stack_trace() gets a separate limit (MAX_TASK_WAITER_WALK_TASKS), on the total number of tasks visited (including duplicates), since its' a graph, not a chain. Stack overflows. Both coro and task-waiter walks were recursive. With 4KB (SIZEOF_TASK_OBJ) 256 was enough to overflow a 1MiB stack. The obvious context here is avoiding infinite loops. Truth be told, I think that in some places torn reads were also responsible for avoiding them and early exits. :-) Issue: gh-153364

Open Graph Description: The PR hardens and cleans up frame, coro and task-waiter walks a bit, by making them iterative and bounded. I'm addressing two issues here: No walk limits. The walks use pointers read from th...

X Description: The PR hardens and cleans up frame, coro and task-waiter walks a bit, by making them iterative and bounded. I'm addressing two issues here: No walk limits. The walks use pointers read fro...

Opengraph URL: https://github.com/python/cpython/pull/153365

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:ebb94e47-f829-931a-9d02-f0dc0a34ee8d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA02E:21DFED:BFB55F:F26879:6B0229C1
html-safe-nonced6612d6e449fda7dd091faa9e0831ebe2819eb59f52efef3c8ef25ca25799e1b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDJFOjIxREZFRDpCRkI1NUY6RjI2ODc5OjZCMDIyOUMxIiwidmlzaXRvcl9pZCI6IjEwNzA4OTUzNTMzOTk3NDkwNTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1196ebab7ffc0e4e3a244f54560d8d96445d78103aa647e9bb0e7913c165b296
hovercard-subject-tagpull_request:4017266582
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/153365/files
twitter:imagehttps://avatars.githubusercontent.com/u/5383?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/5383?s=400&v=4
og:image:altThe PR hardens and cleans up frame, coro and task-waiter walks a bit, by making them iterative and bounded. I'm addressing two issues here: No walk limits. The walks use pointers read from th...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/153365/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F153365%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F153365%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/153365/files
Reloadhttps://github.com/python/cpython/pull/153365/files
Reloadhttps://github.com/python/cpython/pull/153365/files
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
pablogsalhttps://github.com/pablogsal
python:mainhttps://github.com/python/cpython/tree/main
maurycy:tachyon-parse_async_frame_chain-limithttps://github.com/maurycy/cpython/tree/tachyon-parse_async_frame_chain-limit
Conversation 35 https://github.com/python/cpython/pull/153365
Commits 31 https://github.com/python/cpython/pull/153365/commits
Checks 64 https://github.com/python/cpython/pull/153365/checks
Files changed https://github.com/python/cpython/pull/153365/files
Please reload this pagehttps://github.com/python/cpython/pull/153365/files
gh-153364: Make frame, coroutine, and task-waiter chain walks iterative and bounded https://github.com/python/cpython/pull/153365/files#top
Show all changes 31 commits https://github.com/python/cpython/pull/153365/files
4dd6f49 let me declare single limit maurycy Jul 8, 2026 https://github.com/python/cpython/pull/153365/commits/4dd6f49c9a8f7147fd4feb6309235632a3261de3
e71aaa5 use our new limit in process_frame_chain() maurycy Jul 8, 2026 https://github.com/python/cpython/pull/153365/commits/e71aaa566e24844d6a611d72c4b03a015aba3910
116da45 add it in parse_async_frame_chain() maurycy Jul 8, 2026 https://github.com/python/cpython/pull/153365/commits/116da45f642473a69ab724456f3496536dd5e419
3e12939 parse_coro_chain() maurycy Jul 8, 2026 https://github.com/python/cpython/pull/153365/commits/3e12939b13678e46924c4590b00f00dfe1c33e74
c46810c NEWS maurycy Jul 8, 2026 https://github.com/python/cpython/pull/153365/commits/c46810c2f24a060948c6f7666a618c8ca5d018cc
dd6e19a async in the message? maurycy Jul 8, 2026 https://github.com/python/cpython/pull/153365/commits/dd6e19a851391edf9f2a3d3d7d9e08df768b2ffe
0972e00 test maurycy Jul 8, 2026 https://github.com/python/cpython/pull/153365/commits/0972e00fd527f424fb6206b36b768ff71018c50a
3c5f78b no race maurycy Jul 8, 2026 https://github.com/python/cpython/pull/153365/commits/3c5f78be31cfc3cd0b909f9e8b92088bf33c549a
78c18f9 process_task_awaited_by maurycy Jul 10, 2026 https://github.com/python/cpython/pull/153365/commits/78c18f95c6dd9d5eba9c3844b1a93f69ab548338
21d764e process_task_awaited_by limit test maurycy Jul 10, 2026 https://github.com/python/cpython/pull/153365/commits/21d764ef751592db91e6519ec2cfdfd1884cdcca
000287e NEWS maurycy Jul 10, 2026 https://github.com/python/cpython/pull/153365/commits/000287efb4aea797b8a3e25badc49d5e7b0b2591
353f815 MAX_TASK_WAITER_CHAIN_DEPTH maurycy Jul 10, 2026 https://github.com/python/cpython/pull/153365/commits/353f815e63e3c7c48a02b5647af01e6b915ce1d7
f66866b TASK_WAITER_CHAIN_DEPTH in test maurycy Jul 10, 2026 https://github.com/python/cpython/pull/153365/commits/f66866b073851dfc47e825dccd1d1e1057050323
c9f1ebd TASK_WAITER_CHAIN_DEPTH 256 maurycy Jul 10, 2026 https://github.com/python/cpython/pull/153365/commits/c9f1ebdd29c58bed29103f01804ab6374011e189
7236ca2 prevent the drift with the comment maurycy Jul 11, 2026 https://github.com/python/cpython/pull/153365/commits/7236ca27e57d5851b405fa47f5a72663b6493f60
35fc6c6 better naming, better style maurycy Jul 11, 2026 https://github.com/python/cpython/pull/153365/commits/35fc6c61c505509e8bfbffca5bb5216d1f3d32ff
10149e9 MAX_TASK_WAITER_CHAIN_DEPTH comment maurycy Jul 11, 2026 https://github.com/python/cpython/pull/153365/commits/10149e98acc67d77919b0b716e147dc56981256b
ef51563 task-waiter iterative bfs walk maurycy Jul 12, 2026 https://github.com/python/cpython/pull/153365/commits/ef5156320460ab0784f2b630d36651a08cd2a1f6
b5022ba iterative coro-walk maurycy Jul 13, 2026 https://github.com/python/cpython/pull/153365/commits/b5022ba82443cc608030c5730bd1965d30178e97
73b8674 nicer news maurycy Jul 13, 2026 https://github.com/python/cpython/pull/153365/commits/73b8674214b69ce0463b23ba63e7d48e353e69b5
e0607dc 1 << 14 maurycy Jul 25, 2026 https://github.com/python/cpython/pull/153365/commits/e0607dc3fce4d0892f0bc4e4b8c32c23729d1148
ed731eb comment maurycy Jul 25, 2026 https://github.com/python/cpython/pull/153365/commits/ed731eb06fa786379739fbf3bb3c779a24d344dd
75a8d8e unused read_Py_ssize_t maurycy Jul 25, 2026 https://github.com/python/cpython/pull/153365/commits/75a8d8ec7277466d8e2b4fcbdbda64c30797afc2
c0ce737 fix tombstones maurycy Jul 25, 2026 https://github.com/python/cpython/pull/153365/commits/c0ce737fc677c7f6384abaa83bca2d5d71caeb08
f3c80d4 simplify maurycy Jul 25, 2026 https://github.com/python/cpython/pull/153365/commits/f3c80d49dfb0fa525b3e56bae281f3dd1611551d
4fd4027 correct msg maurycy Jul 25, 2026 https://github.com/python/cpython/pull/153365/commits/4fd4027e4586458faa197056643a25899f960e06
f2530ec better test maurycy Jul 25, 2026 https://github.com/python/cpython/pull/153365/commits/f2530ec6b2b8d5e5259e5d22f0c6a23200433389
0ab3342 news for tombstones maurycy Jul 25, 2026 https://github.com/python/cpython/pull/153365/commits/0ab3342504de9d37e96506355dfa95b19c4f0df5
2a444ec left-over from when testing buggy version maurycy Jul 25, 2026 https://github.com/python/cpython/pull/153365/commits/2a444ecb9a2d0c85387169e5bc38a78637d81d78
ed95a2e redundant new line maurycy Jul 25, 2026 https://github.com/python/cpython/pull/153365/commits/ed95a2e0333193b2992caed5252a3575a2f1f60b
a1221fd Merge branch 'main' into tachyon-parse_async_frame_chain-limit maurycy Oct 4, 2026 https://github.com/python/cpython/pull/153365/commits/a1221fdb56dd5723715d190369eed89a1b97edc9
Clear filters https://github.com/python/cpython/pull/153365/files
Please reload this pagehttps://github.com/python/cpython/pull/153365/files
Please reload this pagehttps://github.com/python/cpython/pull/153365/files
test_external_inspection.py https://github.com/python/cpython/pull/153365/files#diff-e23d1425a6f43944cb282709edbeacfa2398f4cd4c109e59dd49366dac46f2d7
2026-07-08-22-18-04.gh-issue-153364.JBFHEg.rst https://github.com/python/cpython/pull/153365/files#diff-e4d10a06c46168de7b22064747ed79e2077f71208db84ab1e534dbf44894fb18
_remote_debugging.h https://github.com/python/cpython/pull/153365/files#diff-a6ce0bef7825b17047f05fdec7aa610bc1d2d2b368e72b6871a79c3b1d2dfaf9
asyncio.c https://github.com/python/cpython/pull/153365/files#diff-d3a9f5049ca6c549a4feb928b6d06a7dbce8486745bb06f6b8254cddce207e32
frames.c https://github.com/python/cpython/pull/153365/files#diff-7d46b926220bc5035fbce1ec940bb27482bcd7683fdcbc1f60b1fd2bb9bf6f41
object_reading.c https://github.com/python/cpython/pull/153365/files#diff-ec10768668a1e6cda8523b815ae89e4a82410875a0b84c03adfd71afea4df62f
Lib/test/test_external_inspection.pyhttps://github.com/python/cpython/pull/153365/files#diff-e23d1425a6f43944cb282709edbeacfa2398f4cd4c109e59dd49366dac46f2d7
View file https://github.com/maurycy/cpython/blob/a1221fdb56dd5723715d190369eed89a1b97edc9/Lib/test/test_external_inspection.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/153365/{{ revealButtonHref }}
https://github.com/python/cpython/pull/153365/files#diff-e23d1425a6f43944cb282709edbeacfa2398f4cd4c109e59dd49366dac46f2d7
https://github.com/python/cpython/pull/153365/files#diff-e23d1425a6f43944cb282709edbeacfa2398f4cd4c109e59dd49366dac46f2d7
https://github.com/python/cpython/pull/153365/files#diff-e23d1425a6f43944cb282709edbeacfa2398f4cd4c109e59dd49366dac46f2d7
https://github.com/python/cpython/pull/153365/files#diff-e23d1425a6f43944cb282709edbeacfa2398f4cd4c109e59dd49366dac46f2d7
https://github.com/python/cpython/pull/153365/files#diff-e23d1425a6f43944cb282709edbeacfa2398f4cd4c109e59dd49366dac46f2d7
https://github.com/python/cpython/pull/153365/files#diff-e23d1425a6f43944cb282709edbeacfa2398f4cd4c109e59dd49366dac46f2d7
https://github.com/python/cpython/pull/153365/files#diff-e23d1425a6f43944cb282709edbeacfa2398f4cd4c109e59dd49366dac46f2d7
Misc/NEWS.d/next/Library/2026-07-08-22-18-04.gh-issue-153364.JBFHEg.rsthttps://github.com/python/cpython/pull/153365/files#diff-e4d10a06c46168de7b22064747ed79e2077f71208db84ab1e534dbf44894fb18
View file https://github.com/maurycy/cpython/blob/a1221fdb56dd5723715d190369eed89a1b97edc9/Misc/NEWS.d/next/Library/2026-07-08-22-18-04.gh-issue-153364.JBFHEg.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/153365/{{ revealButtonHref }}
Please reload this pagehttps://github.com/python/cpython/pull/153365/files
Please reload this pagehttps://github.com/python/cpython/pull/153365/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.