Title: [3.14] gh-151644: Fix data race in sys.setdlopenflags/getdlopenflags under free-threading (gh-151768) by miss-islington · Pull Request #153789 · python/cpython · GitHub
Open Graph Title: [3.14] gh-151644: Fix data race in sys.setdlopenflags/getdlopenflags under free-threading (gh-151768) by miss-islington · Pull Request #153789 · python/cpython
X Title: [3.14] gh-151644: Fix data race in sys.setdlopenflags/getdlopenflags under free-threading (gh-151768) by miss-islington · Pull Request #153789 · python/cpython
Description: In free-threading builds, concurrent calls to sys.getdlopenflags() and sys.setdlopenflags() race on interp->imports.dlopenflags. Fix by using FT_ATOMIC_LOAD_INT_RELAXED / FT_ATOMIC_STORE_INT_RELAXED in _PyImport_GetDLOpenFlags and _PyImport_SetDLOpenFlags, consistent with how analogous interpreter-state integer fields (lazy_imports_mode, pystats_enabled) are protected. Relaxed ordering is correct here: dlopenflags is a standalone config integer with no ordering relationship to other memory. (cherry picked from commit cde31ec) Co-authored-by: Jiucheng(Oliver) git.jiucheng@gmail.com Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com Issue: gh-151644
Open Graph Description: In free-threading builds, concurrent calls to sys.getdlopenflags() and sys.setdlopenflags() race on interp->imports.dlopenflags. Fix by using FT_ATOMIC_LOAD_INT_RELAXED / FT_ATOMIC_STORE_INT_RE...
X Description: In free-threading builds, concurrent calls to sys.getdlopenflags() and sys.setdlopenflags() race on interp->imports.dlopenflags. Fix by using FT_ATOMIC_LOAD_INT_RELAXED / FT_ATOMIC_STORE_IN...
Opengraph URL: https://github.com/python/cpython/pull/153789
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a51c5cb0-b9ff-932f-7d89-bf44428a79a5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E5CA:23BE1E:125ED16:18A44B3:6A595699 |
| html-safe-nonce | 9bfd032f1975ca730e02a558887de1d12ebd1c391348662954e887355c2aa476 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUNBOjIzQkUxRToxMjVFRDE2OjE4QTQ0QjM6NkE1OTU2OTkiLCJ2aXNpdG9yX2lkIjoiNzk2OTc5MzQxODQ5MDEwNzU0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7478585af065c49852514eba327aa47d20bdfed1318653f6b05180191713cf3d |
| hovercard-subject-tag | pull_request:4065065558 |
| 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/153789/files |
| twitter:image | https://avatars.githubusercontent.com/u/31488909?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/31488909?s=400&v=4 |
| og:image:alt | In free-threading builds, concurrent calls to sys.getdlopenflags() and sys.setdlopenflags() race on interp->imports.dlopenflags. Fix by using FT_ATOMIC_LOAD_INT_RELAXED / FT_ATOMIC_STORE_INT_RE... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | a540949572872b935b393b36db38922db390ae71c859537d741b8f3eb7e545b5 |
| 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 | 5f35ad1fb16417d6e6774c537b62a2fe92222907 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width