Title: Free-threaded build crashes when destructor ran in the middle of dict/list resize · Issue #160697 · python/cpython · GitHub
Open Graph Title: Free-threaded build crashes when destructor ran in the middle of dict/list resize · Issue #160697 · python/cpython
X Title: Free-threaded build crashes when destructor ran in the middle of dict/list resize · Issue #160697 · python/cpython
Description: Crash report import threading class Evil: def __del__(self): d[object()] = 0 class C: pass d = {} t = threading.Thread(target=d.get, args=(0,)) t.start() t.join() for _ in range(1000): o = C() o.__dict__ = {"x": Evil()} o.__dict__ = {} f...
Open Graph Description: Crash report import threading class Evil: def __del__(self): d[object()] = 0 class C: pass d = {} t = threading.Thread(target=d.get, args=(0,)) t.start() t.join() for _ in range(1000): o = C() o.__...
X Description: Crash report import threading class Evil: def __del__(self): d[object()] = 0 class C: pass d = {} t = threading.Thread(target=d.get, args=(0,)) t.start() t.join() for _ in range(1000): o = C() o.__...
Opengraph URL: https://github.com/python/cpython/issues/160697
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Free-threaded build crashes when destructor ran in the middle of dict/list resize","articleBody":"### Crash report\n\n```python\nimport threading\n\nclass Evil:\n def __del__(self):\n d[object()] = 0\n\nclass C:\n pass\n\nd = {}\nt = threading.Thread(target=d.get, args=(0,))\nt.start()\nt.join()\n\nfor _ in range(1000):\n o = C()\n o.__dict__ = {\"x\": Evil()}\n o.__dict__ = {}\n for k in list(d):\n del d[k]\n for i in rang\n```\n\nFound this while trying to formally verify parts of CPython :)\n\n### CPython versions tested on:\n\n3.15, 3.14, 3.16, CPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n### Output from running 'python -VV' on the command line:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-160698\n* gh-162330\n* gh-162331\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/Eclips4","@type":"Person","name":"Eclips4"},"datePublished":"2026-10-26T08:17:41Z","url":"https://github.com/python/cpython/issues/160697"}
| 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:36dfd7ba-8ed2-323b-a4e1-0277e97dcb28 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ABE8:27E5CD:3C9B6FE:4D75FDF:6B020233 |
| html-safe-nonce | 9e7f0b021691aeb142ed4554134006a155266c6c7c9954bf8f21703caaf8a703 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkU4OjI3RTVDRDozQzlCNkZFOjRENzVGREY6NkIwMjAyMzMiLCJ2aXNpdG9yX2lkIjoiODY0OTQxMjU3NjUxNTU4ODY1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 96341f04579d1c53f8618f86fe04b922e5844fedc3ee9960de95bc9fdb3df3bc |
| hovercard-subject-tag | issue:6035922882 |
| 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/160697/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7ff4571bb3e003683493d9623e3c3e3e27f21d1f5489e6eec3cda7f97ca61066/python/cpython/issues/160697 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7ff4571bb3e003683493d9623e3c3e3e27f21d1f5489e6eec3cda7f97ca61066/python/cpython/issues/160697 |
| og:image:alt | Crash report import threading class Evil: def __del__(self): d[object()] = 0 class C: pass d = {} t = threading.Thread(target=d.get, args=(0,)) t.start() t.join() for _ in range(1000): o = C() o.__... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Eclips4 |
| 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