Title: new_threadstate() leaks the reserved QSBR slot on failure paths · Issue #155363 · python/cpython · GitHub
Open Graph Title: new_threadstate() leaks the reserved QSBR slot on failure paths · Issue #155363 · python/cpython
X Title: new_threadstate() leaks the reserved QSBR slot on failure paths · Issue #155363 · python/cpython
Description: Bug report Bug description: In the free-threaded build, new_threadstate() reserves a QSBR thread-state slot and a TLBC index before it can fail for other reasons, but the failure paths only free the _PyThreadStateImpl. Found while review...
Open Graph Description: Bug report Bug description: In the free-threaded build, new_threadstate() reserves a QSBR thread-state slot and a TLBC index before it can fail for other reasons, but the failure paths only free th...
X Description: Bug report Bug description: In the free-threaded build, new_threadstate() reserves a QSBR thread-state slot and a TLBC index before it can fail for other reasons, but the failure paths only free th...
Opengraph URL: https://github.com/python/cpython/issues/155363
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"new_threadstate() leaks the reserved QSBR slot on failure paths","articleBody":"# Bug report\n\n### Bug description:\n\nIn the free-threaded build, `new_threadstate()` reserves a QSBR thread-state slot and a TLBC index before it can fail for other reasons, but the failure paths only free the _PyThreadStateImpl.\n\nFound while reviewing GH-148953. I think explaining the monotonic memory growth in the corresponding issue is unlikely, since this leak only happens in the failure case. Still good to fix though.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-155365\n* gh-155579\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/nascheme","@type":"Person","name":"nascheme"},"datePublished":"2026-08-07T20:46:09Z","url":"https://github.com/python/cpython/issues/155363"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:51e28b74-81d2-8164-979d-8a73ef091b3b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B464:2A1EC8:D60F41:10D160E:6B0231B0 |
| html-safe-nonce | f9d087e35911acb4a19e09d84fcbb2b620e90036945df8840b59ecc59dfac650 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDY0OjJBMUVDODpENjBGNDE6MTBEMTYwRTo2QjAyMzFCMCIsInZpc2l0b3JfaWQiOiI1MDM3MDQ1NDkyNzAzNjg2ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b213520fc56add64f1d5b408796890912c7c45f72cde14bd1275eb9ff2d60075 |
| hovercard-subject-tag | issue:5093842429 |
| 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/155363/issue_layout |
| twitter:image | https://opengraph.githubassets.com/edf4c00ee5d87449f60eb35b6a4adde6e0d419de151dd5ba7732335f4742de92/python/cpython/issues/155363 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/edf4c00ee5d87449f60eb35b6a4adde6e0d419de151dd5ba7732335f4742de92/python/cpython/issues/155363 |
| og:image:alt | Bug report Bug description: In the free-threaded build, new_threadstate() reserves a QSBR thread-state slot and a TLBC index before it can fail for other reasons, but the failure paths only free th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nascheme |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width