Title: gh-105699: Use a _Py_hashtable_t for the PyModuleDef Cache by ericsnowcurrently · Pull Request #106974 · python/cpython · GitHub
Open Graph Title: gh-105699: Use a _Py_hashtable_t for the PyModuleDef Cache by ericsnowcurrently · Pull Request #106974 · python/cpython
X Title: gh-105699: Use a _Py_hashtable_t for the PyModuleDef Cache by ericsnowcurrently · Pull Request #106974 · python/cpython
Description: This fixes a crasher due to a race condition, triggered infrequently when two isolated (own GIL) subinterpreters simultaneously initialize their sys or builtins modules. The crash happened due the combination of the "detached" thread state we were using and the "last holder" logic we use for the GIL. It turns out it's tricky to use the same thread state for different threads. Who could have guessed? We solve the problem by eliminating the one object we were still sharing between interpreters. We replace it with a low-level hashtable, using the "raw" allocator to avoid tying it to the main interpreter. We also remove the accommodations for "detached" thread states, which were a dubious idea to start with. (This approach does not have the same potential performance penalty as the linked list we used in gh-106899.) Issue: gh-105699
Open Graph Description: This fixes a crasher due to a race condition, triggered infrequently when two isolated (own GIL) subinterpreters simultaneously initialize their sys or builtins modules. The crash happened due the...
X Description: This fixes a crasher due to a race condition, triggered infrequently when two isolated (own GIL) subinterpreters simultaneously initialize their sys or builtins modules. The crash happened due the...
Opengraph URL: https://github.com/python/cpython/pull/106974
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:3ab49572-4c5e-d3d7-7b10-86f3f7ee7bee |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | E8E4:15D295:EE1604:14B6F3A:696A86CD |
| html-safe-nonce | 2c570811de6f1ff309f8a873376b811c161c6de60a9d162ba4a7f15e48a226d7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOEU0OjE1RDI5NTpFRTE2MDQ6MTRCNkYzQTo2OTZBODZDRCIsInZpc2l0b3JfaWQiOiI4NDM4NTkwOTMyNzgzODkyMTczIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3e93cad0f34271dc4062fb483519d5ffdb71f4b1e0bf31b38b1118e1c80e35db |
| hovercard-subject-tag | pull_request:1445012911 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/106974/checks |
| twitter:image | https://avatars.githubusercontent.com/u/1152074?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1152074?s=400&v=4 |
| og:image:alt | This fixes a crasher due to a race condition, triggered infrequently when two isolated (own GIL) subinterpreters simultaneously initialize their sys or builtins modules. The crash happened due the... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | d2aa6dedd7d97fa651b17c40401f2605f309df5ca5fb659bf0554cf34f1de825 |
| 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 full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c1dbca8981c5e3d6a69bce2f1d289e732b86241d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width