Title: PYTHONMALLOCSTATS=1 fails with fatal error at Python exit · Issue #111499 · python/cpython · GitHub
Open Graph Title: PYTHONMALLOCSTATS=1 fails with fatal error at Python exit · Issue #111499 · python/cpython
X Title: PYTHONMALLOCSTATS=1 fails with fatal error at Python exit · Issue #111499 · python/cpython
Description: Py_FinalizeEx() calls _PyObject_DebugMallocStats() which calls indirectly _PyInterpreterState_GET(). Problem: at this point, there is no "interpreter" anymore, and so _PyInterpreterState_GET() fails with a fatal error. It's a regression ...
Open Graph Description: Py_FinalizeEx() calls _PyObject_DebugMallocStats() which calls indirectly _PyInterpreterState_GET(). Problem: at this point, there is no "interpreter" anymore, and so _PyInterpreterState_GET() fail...
X Description: Py_FinalizeEx() calls _PyObject_DebugMallocStats() which calls indirectly _PyInterpreterState_GET(). Problem: at this point, there is no "interpreter" anymore, and so _PyInterpreterState_...
Opengraph URL: https://github.com/python/cpython/issues/111499
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PYTHONMALLOCSTATS=1 fails with fatal error at Python exit","articleBody":"`Py_FinalizeEx()` calls `_PyObject_DebugMallocStats()` which calls indirectly `_PyInterpreterState_GET()`. Problem: at this point, there is no \"interpreter\" anymore, and so `_PyInterpreterState_GET()` fails with a fatal error.\r\n\r\nIt's a regression introduced by commit df3173d28ef25a0f97d2cca8cf4e64e062a08d06. Python 3.12 is also affected.\r\n\r\nReproducer:\r\n\r\n```\r\n$ PYTHONMALLOCSTATS=1 ./python -c pass\r\nSmall block threshold = 512, in 32 size classes.\r\n(...)\r\nTotal = 262,144\r\n\r\nSmall block threshold = 512, in 32 size classes.\r\n(...)\r\nTotal = 655,360\r\n\r\nFatal Python error: _PyInterpreterState_GET: the function must be called with the GIL held, after Python initialization and before Python finalization, but the GIL is released (the current Python thread state is NULL)\r\nPython runtime state: finalizing (tstate=0x0000000000ae7550)\r\n\r\nAbandon (core dumped)\r\n```\r\n\r\ncc @ericsnowcurrently \n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-120021\n* gh-120022\n* gh-120023\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/vstinner","@type":"Person","name":"vstinner"},"datePublished":"2023-10-30T15:11:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/111499/cpython/issues/111499"}
| 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:1ccbdaa0-ed32-f13b-abef-5beff6937307 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB9C:4BD90:150CBD2:1D7C5A1:696A414B |
| html-safe-nonce | 60c6d83eb2b7a63fe28fc3a1285ba7a637eafa30cbc1987c386c17439826a99a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjlDOjRCRDkwOjE1MENCRDI6MUQ3QzVBMTo2OTZBNDE0QiIsInZpc2l0b3JfaWQiOiIxMDgxMjQyNzA2OTc4MTYwOTcxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4915d2654e641b2b635f478b4cc6b7a65ed26b00f4c3b270e3a8707b6b45aa90 |
| hovercard-subject-tag | issue:1968608897 |
| 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/111499/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ed68db0343d82dc98c5145ef53c5a9369dc2056d8c3642f4ab5d070bf47d815d/python/cpython/issues/111499 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ed68db0343d82dc98c5145ef53c5a9369dc2056d8c3642f4ab5d070bf47d815d/python/cpython/issues/111499 |
| og:image:alt | Py_FinalizeEx() calls _PyObject_DebugMallocStats() which calls indirectly _PyInterpreterState_GET(). Problem: at this point, there is no "interpreter" anymore, and so _PyInterpreterState_GET() fail... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vstinner |
| hostname | github.com |
| expected-hostname | github.com |
| None | 321736bfdb3f591415ae895a0459bec204b26a76caf47ba5c980634cfacc4538 |
| 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 | 13581a31d51edf4a3aca179e10890a4d4f9b6d76 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width