gh-83274: Stop deallocation of Tkapp causing Python interpreter crash#21532
gh-83274: Stop deallocation of Tkapp causing Python interpreter crash#21532E-Paine wants to merge 14 commits into
Conversation
This is mostly to determine if the asyncio failure is a temporary problem (this will force a re-test) or could (somehow) be a result of my changes.
|
@richardsheridan, do you mind please reviewing the new test. A particular note: can you think of a way for this test to not require a subprocess? (we need to test for the crash without crashing the main test interpreter) |
|
|
|
This PR is stale because it has been open for 30 days with no activity. |
|
Picked this up in #152323 — same approach (skip Tcl_DeleteInterp() when deallocating in the wrong thread, leak the interpreter, warn), rebased onto current main and with you credited as co-author. Two changes from this draft: the warning now goes through the warnings machinery (PyErr_WarnEx) so it can be filtered/suppressed, falling back to an unraisable report only if it's escalated to an error (a deallocator can't propagate exceptions); and the test asserts a clean process exit. Thanks for the original analysis and patch. |
I am pretty certain this is not the correct usage of
PyErr_WriteUnraisableso please could someone pay particular attention to that (it was required to stop Python raising aSystemError). It appears to behave correctly during tests, but I am not yet confident in it and so have, for now, marked it as a draft.https://bugs.python.org/issue39093