Title: Need to defer GC tracking of frozenset/set construction · Issue #152235 · python/cpython · GitHub
Open Graph Title: Need to defer GC tracking of frozenset/set construction · Issue #152235 · python/cpython
X Title: Need to defer GC tracking of frozenset/set construction · Issue #152235 · python/cpython
Description: The same bug affects frozenset/set: construction GC-tracks the object before it's filled, so another thread can reach a half-built frozenset via gc.get_objects() mid-construction. ThreadSanitizer confirms it: WARNING: ThreadSanitizer: da...
Open Graph Description: The same bug affects frozenset/set: construction GC-tracks the object before it's filled, so another thread can reach a half-built frozenset via gc.get_objects() mid-construction. ThreadSanitizer c...
X Description: The same bug affects frozenset/set: construction GC-tracks the object before it's filled, so another thread can reach a half-built frozenset via gc.get_objects() mid-construction. ThreadSanitiz...
Opengraph URL: https://github.com/python/cpython/issues/152235
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Need to defer GC tracking of frozenset/set construction","articleBody":"[The same bug](https://github.com/python/cpython/issues/151722) affects frozenset/set: construction GC-tracks the object before it's filled, so another thread can reach a half-built frozenset via gc.get_objects() mid-construction. ThreadSanitizer confirms it:\n\n```\nWARNING: ThreadSanitizer: data race (pid=78348)\nSUMMARY: ThreadSanitizer: data race setobject.c:320 in set_add_entry_takeref\nWARNING: ThreadSanitizer: data race (pid=78348)\nSUMMARY: ThreadSanitizer: data race setobject.c:321 in set_add_entry_takeref\nWARNING: ThreadSanitizer: data race (pid=78348)\nSUMMARY: ThreadSanitizer: data race setobject.c:323 in set_add_entry_takeref\nWARNING: ThreadSanitizer: data race (pid=78348)\nSUMMARY: ThreadSanitizer: data race setobject.c:537 in set_table_resize\nSUMMARY: ThreadSanitizer: SEGV setobject.c:816 in set_repr\n```\n\nI am working on this\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-152237\n* gh-152242\n* gh-152243\n* gh-152272\n* gh-152273\n* gh-152278\n* gh-152279\n* gh-152280\n* gh-152290\n* gh-152312\n* gh-152316\n* gh-152319\n* gh-153079\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/corona10","@type":"Person","name":"corona10"},"datePublished":"2026-06-25T20:22:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/152235/cpython/issues/152235"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:dc5ab46d-f9b4-7a4e-cc21-ead679907f04 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF34:1EA4:6869A8:94D5EF:6A4F4FE5 |
| html-safe-nonce | 3883a169a7e837c495c261177bbd5d93a0c4b49f017b4f0921019e11b406a576 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjM0OjFFQTQ6Njg2OUE4Ojk0RDVFRjo2QTRGNEZFNSIsInZpc2l0b3JfaWQiOiI2MTYzMzk1NTgxODQ4ODAxMjUzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b6d1766a90fb2236ff5c029100ca1a15ea9fa68c280fdf561fbeb1e1a0869d5c |
| hovercard-subject-tag | issue:4747140648 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/152235/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a5a1dc69e9ea30e11b052f408f50756aa264152731e2bf4bd6e1d381141fb143/python/cpython/issues/152235 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a5a1dc69e9ea30e11b052f408f50756aa264152731e2bf4bd6e1d381141fb143/python/cpython/issues/152235 |
| og:image:alt | The same bug affects frozenset/set: construction GC-tracks the object before it's filled, so another thread can reach a half-built frozenset via gc.get_objects() mid-construction. ThreadSanitizer c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | corona10 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4b249b445842943ed31549e027f57a8ade9881ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width