René's URL Explorer Experiment


Title: GH-94262: Don't create frame objects for frames that aren't complete. by markshannon · Pull Request #94371 · python/cpython · GitHub

Open Graph Title: GH-94262: Don't create frame objects for frames that aren't complete. by markshannon · Pull Request #94371 · python/cpython

X Title: GH-94262: Don't create frame objects for frames that aren't complete. by markshannon · Pull Request #94371 · python/cpython

Description: Since 3.11 we have moved some low level operations to the bytecode which mean that frames can be in a partially constructed state during GC, or other operations that could expose them to Python code (or third party C code). We already avoid tracing any instructions before the first RESUME when executing a frame. This PR prevents creating a frame object before the first RESUME has been reached. Issue: gh-94262

Open Graph Description: Since 3.11 we have moved some low level operations to the bytecode which mean that frames can be in a partially constructed state during GC, or other operations that could expose them to Python cod...

X Description: Since 3.11 we have moved some low level operations to the bytecode which mean that frames can be in a partially constructed state during GC, or other operations that could expose them to Python cod...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:f064ce18-afee-8784-43b5-b376a3539692
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB8EE:290BB0:128E26:19E9DE:696A3A07
html-safe-nonce74894a1761637e7193ff2b6c69e33141affc5da55dda3fea0b95947833707d01
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOEVFOjI5MEJCMDoxMjhFMjY6MTlFOURFOjY5NkEzQTA3IiwidmlzaXRvcl9pZCI6IjIyMzUzNDY5MjUzMTkyNDAxOTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac91b7809924063f8016b7b4ed9a8ebe1b5b68b3ce44a4b67cde80b9aef3ecd0fc
hovercard-subject-tagpull_request:981129772
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/94371/files
twitter:imagehttps://avatars.githubusercontent.com/u/9448417?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/9448417?s=400&v=4
og:image:altSince 3.11 we have moved some low level operations to the bytecode which mean that frames can be in a partially constructed state during GC, or other operations that could expose them to Python cod...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None321736bfdb3f591415ae895a0459bec204b26a76caf47ba5c980634cfacc4538
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
release7a9163cefd1ea4bd06f8eb7c082f43e4e53f626f
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/94371/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F94371%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F94371%2Ffiles
Sign up https://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/94371/files
Reloadhttps://github.com/python/cpython/pull/94371/files
Reloadhttps://github.com/python/cpython/pull/94371/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/94371/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/94371/files
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
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
markshannonhttps://github.com/markshannon
python:mainhttps://github.com/python/cpython/tree/main
faster-cpython:no-frame-object-too-earlyhttps://github.com/faster-cpython/cpython/tree/no-frame-object-too-early
Conversation 20 https://github.com/python/cpython/pull/94371
Commits 11 https://github.com/python/cpython/pull/94371/commits
Checks 0 https://github.com/python/cpython/pull/94371/checks
Files changed https://github.com/python/cpython/pull/94371/files
Please reload this pagehttps://github.com/python/cpython/pull/94371/files
GH-94262: Don't create frame objects for frames that aren't complete. https://github.com/python/cpython/pull/94371/files#top
Show all changes 11 commits https://github.com/python/cpython/pull/94371/files
87e97ae Add test for creating frame object when making a generator. markshannon Jun 27, 2022 https://github.com/python/cpython/pull/94371/commits/87e97ae4ad8942bc0cc09174d8964c3e02b6b03b
583d164 Don't expose incomplete frames as frame objects. markshannon Jun 27, 2022 https://github.com/python/cpython/pull/94371/commits/583d16470101800ceac6fc73bb46f37dc853404b
5043a8b Add news markshannon Jun 28, 2022 https://github.com/python/cpython/pull/94371/commits/5043a8bd8bf501cf867fa1ad165058e4b23f0774
e81c1f3 Cleanup after test. markshannon Jun 28, 2022 https://github.com/python/cpython/pull/94371/commits/e81c1f35f32b8fe0c0a1a3b254241c5bb9d71371
6d07165 Explain _PyFrame_IsIncomplete() markshannon Jun 28, 2022 https://github.com/python/cpython/pull/94371/commits/6d071657e154f627126b30b64696cd0692c15467
ce0d4b5 Try harder to break things markshannon Jun 28, 2022 https://github.com/python/cpython/pull/94371/commits/ce0d4b5b8d2255ab3e1ae2aaa2ec39e672f84d2a
f56451b Avoid creating frame objects for incomplete frames vai f_back. markshannon Jun 28, 2022 https://github.com/python/cpython/pull/94371/commits/f56451bc4aea748369d7ba28bff9a28b6e8e4e66
b69e803 Fix test markshannon Jun 28, 2022 https://github.com/python/cpython/pull/94371/commits/b69e8034d9ee549f5b7816b38056400b64dc6e92
c648d46 Assert frame is valid when creating frame object. markshannon Jun 28, 2022 https://github.com/python/cpython/pull/94371/commits/c648d46ec789782cade7541c5182fc476ce1fe52
cf0b32c Prevent test polluting environment markshannon Jun 28, 2022 https://github.com/python/cpython/pull/94371/commits/cf0b32c0216357a893e22d0fe93f744c55c49ec7
939769c Create all frames on stack from finalizer. markshannon Jun 29, 2022 https://github.com/python/cpython/pull/94371/commits/939769cab192429916417b8176b8eea069efecee
Clear filters https://github.com/python/cpython/pull/94371/files
Please reload this pagehttps://github.com/python/cpython/pull/94371/files
Please reload this pagehttps://github.com/python/cpython/pull/94371/files
pycore_frame.h https://github.com/python/cpython/pull/94371/files#diff-dc43b169f3202922a7787b97210ce299172f0cf03bd88529d473128f32e49fe4
test_generators.py https://github.com/python/cpython/pull/94371/files#diff-885d4a7a1816281a78b69ca46cc2b8fa73060bdf5d55cbc54cdebb3d7aa90a52
2022-06-28-10-08-06.gh-issue-94262.m-HWUZ.rst https://github.com/python/cpython/pull/94371/files#diff-8531d00930b55886327c46b6d0782567fda4162211591377875c3a7920cf2275
codeobject.c https://github.com/python/cpython/pull/94371/files#diff-6f869eb8beb7cbe4bc6817584b99ad567f88962fa67f7beca25d009dc401234d
frameobject.c https://github.com/python/cpython/pull/94371/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
frame.c https://github.com/python/cpython/pull/94371/files#diff-a4bce9eacb883a180151a309d9367502a69d7881188f93c7b6c0398249b6c14e
sysmodule.c https://github.com/python/cpython/pull/94371/files#diff-a3a5c73931235f7f344c072dc755d6508e13923db3f5d581c5e88652075871cb
Include/internal/pycore_frame.hhttps://github.com/python/cpython/pull/94371/files#diff-dc43b169f3202922a7787b97210ce299172f0cf03bd88529d473128f32e49fe4
View file https://github.com/faster-cpython/cpython/blob/939769cab192429916417b8176b8eea069efecee/Include/internal/pycore_frame.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/94371/{{ revealButtonHref }}
https://github.com/python/cpython/pull/94371/files#diff-dc43b169f3202922a7787b97210ce299172f0cf03bd88529d473128f32e49fe4
https://github.com/python/cpython/pull/94371/files#diff-dc43b169f3202922a7787b97210ce299172f0cf03bd88529d473128f32e49fe4
https://github.com/python/cpython/pull/94371/files#diff-dc43b169f3202922a7787b97210ce299172f0cf03bd88529d473128f32e49fe4
Lib/test/test_generators.pyhttps://github.com/python/cpython/pull/94371/files#diff-885d4a7a1816281a78b69ca46cc2b8fa73060bdf5d55cbc54cdebb3d7aa90a52
View file https://github.com/faster-cpython/cpython/blob/939769cab192429916417b8176b8eea069efecee/Lib/test/test_generators.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/94371/{{ revealButtonHref }}
https://github.com/python/cpython/pull/94371/files#diff-885d4a7a1816281a78b69ca46cc2b8fa73060bdf5d55cbc54cdebb3d7aa90a52
Please reload this pagehttps://github.com/python/cpython/pull/94371/files
Please reload this pagehttps://github.com/python/cpython/pull/94371/files
https://github.com/python/cpython/pull/94371/files#diff-885d4a7a1816281a78b69ca46cc2b8fa73060bdf5d55cbc54cdebb3d7aa90a52
Misc/NEWS.d/next/Core and Builtins/2022-06-28-10-08-06.gh-issue-94262.m-HWUZ.rsthttps://github.com/python/cpython/pull/94371/files#diff-8531d00930b55886327c46b6d0782567fda4162211591377875c3a7920cf2275
View file https://github.com/faster-cpython/cpython/blob/939769cab192429916417b8176b8eea069efecee/Misc/NEWS.d/next/Core%20and%20Builtins/2022-06-28-10-08-06.gh-issue-94262.m-HWUZ.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/94371/{{ revealButtonHref }}
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L210
Objects/codeobject.chttps://github.com/python/cpython/pull/94371/files#diff-6f869eb8beb7cbe4bc6817584b99ad567f88962fa67f7beca25d009dc401234d
View file https://github.com/faster-cpython/cpython/blob/939769cab192429916417b8176b8eea069efecee/Objects/codeobject.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/94371/{{ revealButtonHref }}
https://github.com/python/cpython/pull/94371/files#diff-6f869eb8beb7cbe4bc6817584b99ad567f88962fa67f7beca25d009dc401234d
https://github.com/python/cpython/pull/94371/files#diff-6f869eb8beb7cbe4bc6817584b99ad567f88962fa67f7beca25d009dc401234d
https://github.com/python/cpython/pull/94371/files#diff-6f869eb8beb7cbe4bc6817584b99ad567f88962fa67f7beca25d009dc401234d
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L212
Objects/frameobject.chttps://github.com/python/cpython/pull/94371/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
View file https://github.com/faster-cpython/cpython/blob/939769cab192429916417b8176b8eea069efecee/Objects/frameobject.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/94371/{{ revealButtonHref }}
https://github.com/python/cpython/pull/94371/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
https://github.com/python/cpython/pull/94371/files#diff-7b8cef249e5cca077d30de4e428a6bde6b9b803464e790e9cffa7e052e19efdd
Python/frame.chttps://github.com/python/cpython/pull/94371/files#diff-a4bce9eacb883a180151a309d9367502a69d7881188f93c7b6c0398249b6c14e
View file https://github.com/faster-cpython/cpython/blob/939769cab192429916417b8176b8eea069efecee/Python/frame.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/94371/{{ revealButtonHref }}
https://github.com/python/cpython/pull/94371/files#diff-a4bce9eacb883a180151a309d9367502a69d7881188f93c7b6c0398249b6c14e
https://github.com/python/cpython/pull/94371/files#diff-a4bce9eacb883a180151a309d9367502a69d7881188f93c7b6c0398249b6c14e
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L243
Python/sysmodule.chttps://github.com/python/cpython/pull/94371/files#diff-a3a5c73931235f7f344c072dc755d6508e13923db3f5d581c5e88652075871cb
View file https://github.com/faster-cpython/cpython/blob/939769cab192429916417b8176b8eea069efecee/Python/sysmodule.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/94371/{{ revealButtonHref }}
https://github.com/python/cpython/pull/94371/files#diff-a3a5c73931235f7f344c072dc755d6508e13923db3f5d581c5e88652075871cb
https://github.com/python/cpython/pull/94371/files#diff-a3a5c73931235f7f344c072dc755d6508e13923db3f5d581c5e88652075871cb
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.