Title: Crash on deallocator of type 'time.struct_time' during finalizing for free-threaded Python · Issue #122527 · python/cpython · GitHub
Open Graph Title: Crash on deallocator of type 'time.struct_time' during finalizing for free-threaded Python · Issue #122527 · python/cpython
X Title: Crash on deallocator of type 'time.struct_time' during finalizing for free-threaded Python · Issue #122527 · python/cpython
Description: Crash report What happened? A simple standalone file: # test1.py import time obj = time.struct_time(range(1, 10)) $ pyenv install 3.14t-dev --debug $ pyenv local 3.14t-dev-debug $ python3 -VV Python 3.14.0a0 experimental free-threading b...
Open Graph Description: Crash report What happened? A simple standalone file: # test1.py import time obj = time.struct_time(range(1, 10)) $ pyenv install 3.14t-dev --debug $ pyenv local 3.14t-dev-debug $ python3 -VV Pytho...
X Description: Crash report What happened? A simple standalone file: # test1.py import time obj = time.struct_time(range(1, 10)) $ pyenv install 3.14t-dev --debug $ pyenv local 3.14t-dev-debug $ python3 -VV Pytho...
Opengraph URL: https://github.com/python/cpython/issues/122527
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash on deallocator of type 'time.struct_time' during finalizing for free-threaded Python","articleBody":"# Crash report\r\n\r\n### What happened?\r\n\r\nA simple standalone file:\r\n\r\n```python\r\n# test1.py\r\n\r\nimport time\r\n\r\nobj = time.struct_time(range(1, 10))\r\n```\r\n\r\n```console\r\n$ pyenv install 3.14t-dev --debug\r\n$ pyenv local 3.14t-dev-debug\r\n$ python3 -VV\r\nPython 3.14.0a0 experimental free-threading build (heads/main:bd3d31f, Aug 1 2024, 01:22:33) [Clang 15.0.0 (clang-1500.3.9.4)]\r\n$ python3 test1.py\r\nFatal Python error: _Py_Dealloc: Deallocator of type 'time.struct_time' raised an exception\r\nPython runtime state: finalizing (tstate=0x00000001018ca548)\r\nException ignored in the internal traceback machinery:\r\nImportError: sys.meta_path is None, Python is likely shutting down\r\nTypeError: Missed attribute 'n_fields' of type time.struct_time\r\n\r\nCurrent thread 0x00000001fff70c00 (most recent call first):\r\n Garbage-collecting\r\n \u003cno Python frame>\r\n[1] 89377 abort python3 test1.py\r\n$ python3 -c 'import test1'\r\nFatal Python error: _Py_Dealloc: Deallocator of type 'time.struct_time' raised an exception\r\nPython runtime state: finalizing (tstate=0x00000001040a2548)\r\nException ignored in the internal traceback machinery:\r\nImportError: sys.meta_path is None, Python is likely shutting down\r\nTypeError: Missed attribute 'n_fields' of type time.struct_time\r\n\r\nCurrent thread 0x00000001fff70c00 (most recent call first):\r\n Garbage-collecting\r\n \u003cno Python frame>\r\n[1] 89737 abort python3 -c 'import test1'\r\n```\r\n\r\nIf I remove the assignment for `obj`, the program can exit successfully.\r\n\r\n```python\r\n# test2.py\r\n\r\nimport time\r\n\r\ntime.struct_time(range(1, 10))\r\n```\r\n\r\n```console\r\n$ python3 test2.py # no output\r\n$ python3 -c 'import test2' # no output\r\n```\r\n\r\n### CPython versions tested on:\r\n\r\nCPython main branch, CPython 3.13t, CPython 3.14t\r\n\r\n### Operating systems tested on:\r\n\r\nLinux, macOS\r\n\r\n### Output from running 'python -VV' on the command line:\r\n\r\nPython 3.14.0a0 experimental free-threading build (heads/main:bd3d31f, Aug 1 2024, 01:22:33) [Clang 15.0.0 (clang-1500.3.9.4)]\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-122577\n* gh-122625\n* gh-122626\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/XuehaiPan","@type":"Person","name":"XuehaiPan"},"datePublished":"2024-07-31T17:29:15Z","url":"https://github.com/python/cpython/issues/122527"}
| 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:db5a61e2-28e4-2987-c184-e70139ee72b0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 89B8:38E318:3C294B4:4C0519C:6B023AA4 |
| html-safe-nonce | 2e83af822273a73ee841c81b58ac909d2a56877b333f430232aee56cfe6ff262 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OUI4OjM4RTMxODozQzI5NEI0OjRDMDUxOUM6NkIwMjNBQTQiLCJ2aXNpdG9yX2lkIjoiODcyOTA4ODcxNjY4NzE2MjAyMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bb7930186a6bcc7f7f5882aaae6a97819bf80786b8e2a005e5cc1d75e9152038 |
| hovercard-subject-tag | issue:2440547257 |
| 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/122527/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b1eae76a61bb884ed527ee26a7e4d47ea59bf95562184086f7da177bd5556f97/python/cpython/issues/122527 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b1eae76a61bb884ed527ee26a7e4d47ea59bf95562184086f7da177bd5556f97/python/cpython/issues/122527 |
| og:image:alt | Crash report What happened? A simple standalone file: # test1.py import time obj = time.struct_time(range(1, 10)) $ pyenv install 3.14t-dev --debug $ pyenv local 3.14t-dev-debug $ python3 -VV Pytho... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | XuehaiPan |
| 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