Title: Data race in `gc_collect_internal` on `gcstate->last_mem` · Issue #134801 · python/cpython · GitHub
Open Graph Title: Data race in `gc_collect_internal` on `gcstate->last_mem` · Issue #134801 · python/cpython
X Title: Data race in `gc_collect_internal` on `gcstate->last_mem` · Issue #134801 · python/cpython
Description: Bug report Bug description: Races assigning to __dict__ should be thread safe ... ================== WARNING: ThreadSanitizer: data race (pid=3951040) Write of size 8 at 0x555555f78438 by thread T60: #0 gc_collect_internal /home/sgross/c...
Open Graph Description: Bug report Bug description: Races assigning to __dict__ should be thread safe ... ================== WARNING: ThreadSanitizer: data race (pid=3951040) Write of size 8 at 0x555555f78438 by thread T6...
X Description: Bug report Bug description: Races assigning to __dict__ should be thread safe ... ================== WARNING: ThreadSanitizer: data race (pid=3951040) Write of size 8 at 0x555555f78438 by thread T6...
Opengraph URL: https://github.com/python/cpython/issues/134801
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Data race in `gc_collect_internal` on `gcstate-\u003elast_mem`","articleBody":"# Bug report\n\n### Bug description:\n\n```\nRaces assigning to __dict__ should be thread safe ... ==================\nWARNING: ThreadSanitizer: data race (pid=3951040)\n Write of size 8 at 0x555555f78438 by thread T60:\n #0 gc_collect_internal /home/sgross/cpython/Python/gc_free_threading.c:2248:30 (python+0x59a09e) (BuildId: 29173f71c99127c1e5ec9850aea4c8892a29468f)\n #1 gc_collect_main /home/sgross/cpython/Python/gc_free_threading.c:2313:5 (python+0x595027) (BuildId: 29173f71c99127c1e5ec9850aea4c8892a29468f)\n #2 _Py_RunGC /home/sgross/cpython/Python/gc_free_threading.c:2762:5 (python+0x595bd5) (BuildId: 29173f71c99127c1e5ec9850aea4c8892a29468f)\n #3 _Py_HandlePending /home/sgross/cpython/Python/ceval_gil.c:1395:9 (python+0x5aa283) (BuildId: 29173f71c99127c1e5ec9850aea4c8892a29468f)\n\n...\n\n Previous read of size 8 at 0x555555f78438 by thread T62:\n #0 gc_should_collect_mem_usage /home/sgross/cpython/Python/gc_free_threading.c:2065:36 (python+0x596f36) (BuildId: 29173f71c99127c1e5ec9850aea4c8892a29468f)\n #1 gc_should_collect /home/sgross/cpython/Python/gc_free_threading.c:2103:12 (python+0x596f36)\n #2 record_allocation /home/sgross/cpython/Python/gc_free_threading.c:2120:13 (python+0x595b08) (BuildId: 29173f71c99127c1e5ec9850aea4c8892a29468f)\n #3 _PyObject_GC_Link /home/sgross/cpython/Python/gc_free_threading.c:2753:5 (python+0x595b08)\n```\n\ncc @nascheme \n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_","author":{"url":"https://github.com/colesbury","@type":"Person","name":"colesbury"},"datePublished":"2025-05-27T16:58:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/134801/cpython/issues/134801"}
| 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:fade1a47-86fb-8944-4191-96cd86cd634f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D4A8:108FC:28643F8:366C9DB:6A53A39B |
| html-safe-nonce | 961c937e0f22645c05de795cba8ef9594cd99a0cdcf409a1875524ecfb2f3cda |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENEE4OjEwOEZDOjI4NjQzRjg6MzY2QzlEQjo2QTUzQTM5QiIsInZpc2l0b3JfaWQiOiIzNTc3MjM3NTY3ODA3MTM2NjY3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | bf655439344fddca24b2360e185ab42089806a627fb93869704648b966cbb352 |
| hovercard-subject-tag | issue:3094589810 |
| 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/134801/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3d775c4184a038fbe6515ca3e48b776582e24eb863b5ea2b7da4482986b9d2b7/python/cpython/issues/134801 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3d775c4184a038fbe6515ca3e48b776582e24eb863b5ea2b7da4482986b9d2b7/python/cpython/issues/134801 |
| og:image:alt | Bug report Bug description: Races assigning to __dict__ should be thread safe ... ================== WARNING: ThreadSanitizer: data race (pid=3951040) Write of size 8 at 0x555555f78438 by thread T6... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | colesbury |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width