Title: gh-151218: Fix data race in sys_set_flag for free-threading by bhuvi27 · Pull Request #151220 · python/cpython · GitHub
Open Graph Title: gh-151218: Fix data race in sys_set_flag for free-threading by bhuvi27 · Pull Request #151220 · python/cpython
X Title: gh-151218: Fix data race in sys_set_flag for free-threading by bhuvi27 · Pull Request #151220 · python/cpython
Description: Fixes #151218 Concurrent calls to sys.set_int_max_str_digits() in free-threaded builds could double-free the same sys.flags tuple item because sys_set_flag() updated the slot without synchronization. Protect sys.flags updates with a mutex in free-threaded builds, and hold the same lock across flag and interpreter int_max_str_digits state updates so sys.get_int_max_str_digits() stays consistent with sys.flags. Add a concurrent stress regression test in test_sys.py. Issue: gh-151218
Open Graph Description: Fixes #151218 Concurrent calls to sys.set_int_max_str_digits() in free-threaded builds could double-free the same sys.flags tuple item because sys_set_flag() updated the slot without synchronizatio...
X Description: Fixes #151218 Concurrent calls to sys.set_int_max_str_digits() in free-threaded builds could double-free the same sys.flags tuple item because sys_set_flag() updated the slot without synchronizatio...
Opengraph URL: https://github.com/python/cpython/pull/151220
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b37733e8-4fcd-7d3c-c073-e1040e15c0bc |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8736:1E3843:9C9CC9:D101B7:6A5A843B |
| html-safe-nonce | c87e1610c128ca417d725eed1b713a83d38595b3c1988e3a99a3f71fc25b3474 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzM2OjFFMzg0Mzo5QzlDQzk6RDEwMUI3OjZBNUE4NDNCIiwidmlzaXRvcl9pZCI6IjcxMDA1MTM0MTgxMjY5ODQyNTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 59bade97c0cc9031325625774a3aad481e7ee1d14aca530cd4bf08b57e0e30cc |
| hovercard-subject-tag | pull_request:3836886758 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/151220/files |
| twitter:image | https://avatars.githubusercontent.com/u/15888476?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/15888476?s=400&v=4 |
| og:image:alt | Fixes #151218 Concurrent calls to sys.set_int_max_str_digits() in free-threaded builds could double-free the same sys.flags tuple item because sys_set_flag() updated the slot without synchronizatio... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 922bdba685ea48400234d557977f0e32d9adbae6f5125725b4f48cacc6801106 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c8a44665d760d73ead7e85d8f88b299152aa681 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width