Title: 3.15: gh-142349 backport moves `c_stack_refs` in `_PyThreadStateImpl`, breaking greenlet's rc2-built wheels · Issue #158593 · python/cpython · GitHub
Open Graph Title: 3.15: gh-142349 backport moves `c_stack_refs` in `_PyThreadStateImpl`, breaking greenlet's rc2-built wheels · Issue #158593 · python/cpython
X Title: 3.15: gh-142349 backport moves `c_stack_refs` in `_PyThreadStateImpl`, breaking greenlet's rc2-built wheels · Issue #158593 · python/cpython
Description: Bug report Because in RC1 release you said, the following bug is only an issue for wheels built on RC2 and doesn't reproduce on new builds from source: ▎ "There will be no ABI changes from this point forward in the 3.15 series" ▎ "Any bi...
Open Graph Description: Bug report Because in RC1 release you said, the following bug is only an issue for wheels built on RC2 and doesn't reproduce on new builds from source: ▎ "There will be no ABI changes from this poi...
X Description: Bug report Because in RC1 release you said, the following bug is only an issue for wheels built on RC2 and doesn't reproduce on new builds from source: ▎ "There will be no ABI changes from...
Opengraph URL: https://github.com/python/cpython/issues/158593
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"3.15: gh-142349 backport moves `c_stack_refs` in `_PyThreadStateImpl`, breaking greenlet's rc2-built wheels","articleBody":"### Bug report\n\nBecause in [RC1 release](https://www.python.org/downloads/release/python-3150rc1/) you said, the following bug is only an issue for wheels built on RC2 and doesn't reproduce on new builds from source:\n\n> ▎ \"There will be no ABI changes from this point forward in the 3.15 series\"\n> ▎ \"Any binary wheels built against Python 3.15.0 release candidates will work with future versions of Python 3.15.\"\n\n----------\n\nThe 3.15 backport of gh-142349 (#158569, 021f634ed8) adds lazy_imports in the middle of _PyThreadStateImpl. On free-threaded builds this moves c_stack_refs from offset 1088 to 1096.\n\ngreenlet reads c_stack_refs on every switch. Its cp315t wheels on PyPI were built against rc2, so on the current 3.15 branch they read the wrong field and grow memory until the process is killed. In a pytest run this pushed a 64 GB machine into an OOM in under a minute. \n\nBuilding greenlet from source fixes it.\n\nCould lazy_imports go at the end of the struct, so wheels built against rc1/rc2 keep working on 3.15.0?\n\nThe script below runs one switch in a child process and kills it past 1 GiB:\n```python\nuv run --python \u003cfree-threaded build of the 3.15 branch> greenlet_315_repro.py \n```\n[greenlet_315_repro.py](https://github.com/user-attachments/files/32948989/greenlet_315_repro.py)\n\ncc @pablogsal @hugovk\n\n\n### CPython versions tested on:\n\n3.15\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-158594\n* gh-158595\n* gh-158596\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/ddorian","@type":"Person","name":"ddorian"},"datePublished":"2026-10-02T08:04:57Z","url":"https://github.com/python/cpython/issues/158593"}
| 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:b2937a6a-1f56-eaa0-4be6-ab73f7945dd2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A720:2AAD2E:32FCCD4:440FDDC:6B01F9D7 |
| html-safe-nonce | 72f47e08b9d9026fdda523c58e68cfc94bb34f5a5101d51b600c88ab9996598e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzIwOjJBQUQyRTozMkZDQ0Q0OjQ0MEZEREM6NkIwMUY5RDciLCJ2aXNpdG9yX2lkIjoiNTQ3MzE1NTU3NTMxMzQ2Mzc2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6abbe1cd118b9749857d1e9da3bc3031d305381f56611f24afed78b56f827875 |
| hovercard-subject-tag | issue:5674656038 |
| 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/158593/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d256059688ab5b828deba1206b7782b511feee77c5644d363131c85a66c94bef/python/cpython/issues/158593 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d256059688ab5b828deba1206b7782b511feee77c5644d363131c85a66c94bef/python/cpython/issues/158593 |
| og:image:alt | Bug report Because in RC1 release you said, the following bug is only an issue for wheels built on RC2 and doesn't reproduce on new builds from source: ▎ "There will be no ABI changes from this poi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ddorian |
| 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