René's URL Explorer Experiment


Title: Torn reads of GC statistics from external process via get_gc_stats · Issue #155811 · python/cpython · GitHub

Open Graph Title: Torn reads of GC statistics from external process via get_gc_stats · Issue #155811 · python/cpython

X Title: Torn reads of GC statistics from external process via get_gc_stats · Issue #155811 · python/cpython

Description: Bug report Bug description: If an external tool sampling GC statistics does not pause the target process (and we designed get_gc_stats not to pause), it can read torn data under certain circumstances. There are two distinct problems: Wea...

Open Graph Description: Bug report Bug description: If an external tool sampling GC statistics does not pause the target process (and we designed get_gc_stats not to pause), it can read torn data under certain circumstanc...

X Description: Bug report Bug description: If an external tool sampling GC statistics does not pause the target process (and we designed get_gc_stats not to pause), it can read torn data under certain circumstanc...

Opengraph URL: https://github.com/python/cpython/issues/155811

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Torn reads of GC statistics from external process via get_gc_stats","articleBody":"# Bug report\n\n### Bug description:\n\nIf an external tool sampling GC statistics does not pause the target process (and we designed `get_gc_stats` not to pause), it can read torn data under certain circumstances.\n\nThere are two distinct problems:\n\n1. **Weakly ordered platforms**: The stores of `ts_start` and `ts_stop` may be reordered by the CPU/optimizer. We need to add memory barriers to mitigate this.\n\n2. **Large memcpy window**: We are copying a sufficiently large memory region via `memcpy`. If two or more GC cycles occur during this copy, we can end up with inconsistent data spanning multiple GC states.\n\n@maurycy has an idea to use a sequence counter for consistency checks — I think he should definitely give it a try.\n\ncc @pablogsal \n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-155828\n* gh-158829\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/sergey-miryanov","@type":"Person","name":"sergey-miryanov"},"datePublished":"2026-08-14T20:34:06Z","url":"https://github.com/python/cpython/issues/155811"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:dc9e659b-4e9c-b54d-9540-3f3a4b7c7aae
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC544:A71F9:361077D:446A8EB:6B021BAC
html-safe-nonce7afd81d4663d5b050f26f1b46eb90c0075423f0652e5026613160eed84d88a5a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTQ0OkE3MUY5OjM2MTA3N0Q6NDQ2QThFQjo2QjAyMUJBQyIsInZpc2l0b3JfaWQiOiI2NjE3MDI4MzI1ODM0ODIyODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf7ca98a0f058995b8850333ce3080d6e4f12eb7f2eb0319d85f02a3cb56b0117
hovercard-subject-tagissue:5155437847
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/155811/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8032779eb036faa05799a631bebefbc4c416eec772540f04ca0fe77c92e813ab/python/cpython/issues/155811
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8032779eb036faa05799a631bebefbc4c416eec772540f04ca0fe77c92e813ab/python/cpython/issues/155811
og:image:altBug report Bug description: If an external tool sampling GC statistics does not pause the target process (and we designed get_gc_stats not to pause), it can read torn data under certain circumstanc...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesergey-miryanov
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
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
disable-turbofalse
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
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/155811#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F155811
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%2Fissues%2F155811
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/155811
Reloadhttps://github.com/python/cpython/issues/155811
Reloadhttps://github.com/python/cpython/issues/155811
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
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/155811
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/155811
Torn reads of GC statistics from external process via get_gc_statshttps://github.com/python/cpython/issues/155811#top
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
3.16new features, bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.16%22
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/sergey-miryanov
sergey-miryanovhttps://github.com/sergey-miryanov
on Aug 14, 2026https://github.com/python/cpython/issues/155811#issue-5155437847
@maurycyhttps://github.com/maurycy
@pablogsalhttps://github.com/pablogsal
gh-155811: Add a seqcount to gc_stats to prevent torn reads #155828https://github.com/python/cpython/pull/155828
[3.15] gh-155811: Add a seqcount to gc_stats to prevent torn reads (GH-155828) #158829https://github.com/python/cpython/pull/158829
sergey-miryanovhttps://github.com/sergey-miryanov
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
3.16new features, bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.16%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
on Aug 14, 2026https://github.com/python/cpython/issues/155811#event-29479684295
https://github.com/sergey-miryanov
sergey-miryanovhttps://github.com/sergey-miryanov
on Aug 14, 2026https://github.com/python/cpython/issues/155811#issuecomment-5297952225
pablogsalhttps://github.com/pablogsal
on Oct 5, 2026https://github.com/python/cpython/issues/155811#event-32469874519
pythongh-155811: Retry an inconsistent GC snapshot oncehttps://github.com/maurycy/cpython/commit/577305e2bc0efc98043b84d7a7da949290a82467
pythongh-155811https://github.com/python/cpython/issues/155811
577305ehttps://github.com/maurycy/cpython/commit/577305e2bc0efc98043b84d7a7da949290a82467
gh-155811: Add a seqcount to `gc_stats` to prevent torn reads (#155828)https://github.com/python/cpython/commit/5fecd448bb120378978a37dde65dfce233d88c0d
gh-155811https://github.com/python/cpython/issues/155811
#155828https://github.com/python/cpython/pull/155828
5fecd44https://github.com/python/cpython/commit/5fecd448bb120378978a37dde65dfce233d88c0d
https://github.com/maurycy
maurycyhttps://github.com/maurycy
on Oct 5, 2026https://github.com/python/cpython/issues/155811#issuecomment-5990039565
@sergey-miryanovhttps://github.com/sergey-miryanov
https://github.com/sergey-miryanov
sergey-miryanovhttps://github.com/sergey-miryanov
on Oct 5, 2026https://github.com/python/cpython/issues/155811#issuecomment-5990335282
@hugovkhttps://github.com/hugovk
https://github.com/hugovk
hugovkhttps://github.com/hugovk
on Oct 5, 2026https://github.com/python/cpython/issues/155811#issuecomment-5990411940
https://discuss.python.org/t/python-3-15-following-tradition-lets-have-a-surprise-rc3/109313https://discuss.python.org/t/python-3-15-following-tradition-lets-have-a-surprise-rc3/109313
pablogsalhttps://github.com/pablogsal
on Oct 5, 2026https://github.com/python/cpython/issues/155811#event-32493690228
[3.15] gh-155811: Add a seqcount to `gc_stats` to prevent torn reads (G…https://github.com/python/cpython/commit/028124039c276f73fbc26036f1629c91be4c2891
gh-155811https://github.com/python/cpython/issues/155811
G…https://github.com/python/cpython/pull/155828
0281240https://github.com/python/cpython/commit/028124039c276f73fbc26036f1629c91be4c2891
sergey-miryanovhttps://github.com/sergey-miryanov
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 5, 2026https://github.com/python/cpython/issues/155811#event-32525764251
pablogsalhttps://github.com/pablogsal
on Oct 5, 2026https://github.com/python/cpython/issues/155811#event-32527722412
Revert "[3.15] pythongh-155811: Add a seqcount to `gc_stats` to preve…https://github.com/pablogsal/cpython/commit/693eccc47222c9fa3dcb941a671176bd9494c3f4
pythongh-155811https://github.com/python/cpython/issues/155811
693eccchttps://github.com/pablogsal/cpython/commit/693eccc47222c9fa3dcb941a671176bd9494c3f4
Kronuzhttps://github.com/Kronuz
on Oct 5, 2026https://github.com/python/cpython/issues/155811#event-32546719999
pythongh-146527, pythongh-155811: Backport out-of-process GC statisti…https://github.com/Kronuz/cpython/commit/a9a6d3afdc251d0dd1b5220156b5b0d41cea7daf
pythongh-146527https://github.com/python/cpython/issues/146527
pythongh-155811https://github.com/python/cpython/issues/155811
a9a6d3ahttps://github.com/Kronuz/cpython/commit/a9a6d3afdc251d0dd1b5220156b5b0d41cea7daf
pythongh-146527, pythongh-155811: Backport out-of-process GC statisti…https://github.com/Kronuz/cpython/commit/5f652ff8595763643efd3f6098a762aa93f72a93
pythongh-146527https://github.com/python/cpython/issues/146527
pythongh-155811https://github.com/python/cpython/issues/155811
5f652ffhttps://github.com/Kronuz/cpython/commit/5f652ff8595763643efd3f6098a762aa93f72a93
pythongh-146527, pythongh-155811: Backport out-of-process GC statisti…https://github.com/Kronuz/cpython/commit/70b3c2df6c57ba6135c49b5ce3795d35a3258402
pythongh-146527https://github.com/python/cpython/issues/146527
pythongh-155811https://github.com/python/cpython/issues/155811
70b3c2dhttps://github.com/Kronuz/cpython/commit/70b3c2df6c57ba6135c49b5ce3795d35a3258402
pythongh-146527, pythongh-155811: Backport out-of-process GC statisti…https://github.com/Kronuz/cpython/commit/345325384706608f1da137c90cd8557aba511660
pythongh-146527https://github.com/python/cpython/issues/146527
pythongh-155811https://github.com/python/cpython/issues/155811
3453253https://github.com/Kronuz/cpython/commit/345325384706608f1da137c90cd8557aba511660
pythongh-146527, pythongh-155811: Backport out-of-process GC statisti…https://github.com/Kronuz/cpython/commit/c8d47d40dd06df1d27e2c2759e5e517568d80be4
pythongh-146527https://github.com/python/cpython/issues/146527
pythongh-155811https://github.com/python/cpython/issues/155811
c8d47d4https://github.com/Kronuz/cpython/commit/c8d47d40dd06df1d27e2c2759e5e517568d80be4
pythongh-146527, pythongh-155811: Backport out-of-process GC statisti…https://github.com/Kronuz/cpython/commit/7ecdc72ba789ad789e642ba992daff86269297c6
pythongh-146527https://github.com/python/cpython/issues/146527
pythongh-155811https://github.com/python/cpython/issues/155811
7ecdc72https://github.com/Kronuz/cpython/commit/7ecdc72ba789ad789e642ba992daff86269297c6
sergey-miryanovhttps://github.com/sergey-miryanov
on Oct 7, 2026https://github.com/python/cpython/issues/155811#event-32707452911
hugovkhttps://github.com/hugovk
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 11, 2026https://github.com/python/cpython/issues/155811#event-32976512962
https://github.com/sergey-miryanov
sergey-miryanovhttps://github.com/sergey-miryanov
on Oct 11, 2026https://github.com/python/cpython/issues/155811#issuecomment-6109703265
@hugovkhttps://github.com/hugovk
c49b3dchttps://github.com/python/cpython/commit/c49b3dc3cdd0ec20aeee697a5bc37c634b5f2820
pablogsalhttps://github.com/pablogsal
on Oct 11, 2026https://github.com/python/cpython/issues/155811#event-32989722368
[3.15] Restore deferred backports for 3.15.1, including GH-158874 (#1…https://github.com/python/cpython/commit/4ceb3faf2c1f5bf17c56be085c4b1c1b38e47f9e
GH-158874https://github.com/python/cpython/pull/158874
#1…https://github.com/python/cpython/pull/158882
4ceb3fahttps://github.com/python/cpython/commit/4ceb3faf2c1f5bf17c56be085c4b1c1b38e47f9e
https://github.com/hugovk
hugovkhttps://github.com/hugovk
on Oct 11, 2026https://github.com/python/cpython/issues/155811#issuecomment-6112966579
#158882https://github.com/python/cpython/pull/158882
https://github.com/sergey-miryanov
sergey-miryanovhttps://github.com/sergey-miryanov
on Oct 11, 2026https://github.com/python/cpython/issues/155811#issuecomment-6113746664
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/155811
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/155811
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
3.16new features, bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.16%22
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
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.