Title: Crash in asyncio when printing a task object at teardown · Issue #96232 · python/cpython · GitHub
Open Graph Title: Crash in asyncio when printing a task object at teardown · Issue #96232 · python/cpython
X Title: Crash in asyncio when printing a task object at teardown · Issue #96232 · python/cpython
Description: If a task object is still alive at interpreter teardown, something can try to print it. This will end in _asyncio.Future._repr_info that in turn calls: return PyObject_CallOneArg(asyncio_future_repr_info_func, (PyObject *)self); but asyn...
Open Graph Description: If a task object is still alive at interpreter teardown, something can try to print it. This will end in _asyncio.Future._repr_info that in turn calls: return PyObject_CallOneArg(asyncio_future_rep...
X Description: If a task object is still alive at interpreter teardown, something can try to print it. This will end in _asyncio.Future._repr_info that in turn calls: return PyObject_CallOneArg(asyncio_future_rep...
Opengraph URL: https://github.com/python/cpython/issues/96232
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash in asyncio when printing a task object at teardown","articleBody":"If a task object is still alive at interpreter teardown, something can try to print it. This will end in `_asyncio.Future._repr_info` that in turn calls:\r\n\r\n```\r\nreturn PyObject_CallOneArg(asyncio_future_repr_info_func, (PyObject *)self);\r\n```\r\n\r\nbut `asyncio_future_repr_info_func` at that point can be `NULL` because `module_free` of `_asynciomodule.c` has been executed already, called by `Py_FinalizeEx -\u003e finalize_modules -\u003e _PyInterpreterState_ClearModules -\u003e ... -\u003e module_dealloc`.\r\n\r\nThe crash happens in the last `_PyGC_CollectNoFail` of `finalize_modules` so somehow the task survived the first collection and then was garbage in the second one.\r\n\r\nI don;t have a simple repro for now, but you can get the failure by cloning https://github.com/Textualize/textual checking commit 5fe47da058564b72e5081a5658c054f55a5d85cd, installing the project and test deps and running `pytest`.","author":{"url":"https://github.com/pablogsal","@type":"Person","name":"pablogsal"},"datePublished":"2022-08-24T11:43:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/96232/cpython/issues/96232"}
| 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:e60ead25-9d7d-fd78-0f02-fd1e8b5529a6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9722:2F9DEC:1E4CCED:2A808DD:696A599D |
| html-safe-nonce | 48503541c8d8a16cf45efd1644ef6e14dda6375f4dc93495d0dba3b68006490f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzIyOjJGOURFQzoxRTRDQ0VEOjJBODA4REQ6Njk2QTU5OUQiLCJ2aXNpdG9yX2lkIjoiMzc0MDY1Mzc3MTk2MDI0NDYzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 90536fc9a6c0f8497ca5b97aa71ef9f94cfde9e58aa6760dfd8c3ddd67fe3b35 |
| hovercard-subject-tag | issue:1349310304 |
| 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/96232/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0958eeb2d4089da4ecaa927801143640e1031219fe41d71f9ad12a5f7f65193e/python/cpython/issues/96232 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0958eeb2d4089da4ecaa927801143640e1031219fe41d71f9ad12a5f7f65193e/python/cpython/issues/96232 |
| og:image:alt | If a task object is still alive at interpreter teardown, something can try to print it. This will end in _asyncio.Future._repr_info that in turn calls: return PyObject_CallOneArg(asyncio_future_rep... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pablogsal |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef |
| 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 | 63c426b30d262aba269ef14c40e3c817b384cd61 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width