Uh oh!
There was an error while loading. Please reload this page.
gh-140080: Fix atexit with low memory - #140103
Conversation
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
ZeroIntensity
left a comment
There was a problem hiding this comment.
Since the 3.15 alpha is today, please add a news entry so we can know what was fixed in the next release.
Also, per usual, this needs a test case. At a glance, this should be reproducible by calling set_nomemory after registering an atexit callback.
yihong0618
commented
Oct 14, 2025
of course will try, but the test things maybe need some help( - -) and also bring the 3.13(no_memory) tests is that under plan need to add in this pull request? |
ZeroIntensity
commented
Oct 14, 2025
Let's do that in a different PR, because we'll want that in 3.14 as well. |
yihong0618
commented
Oct 14, 2025
ok will do it later, thank you for the help~ |
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
yihong0618
commented
Oct 14, 2025
Done, before the patch the tests hangs tests from #138491 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Victor Stinner <vstinner@python.org>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
vstinner
left a comment
There was a problem hiding this comment.
Python 3.13 is not affected, atexit doesn't use PyObject *copy = PyList_GetSlice(state->callbacks, 0, PyList_GET_SIZE(state->callbacks)); in this version.
yihong0618
commented
Oct 15, 2025
FYI: 3.14 not hang |
yihong0618
commented
Oct 15, 2025
Thank you! |
ZeroIntensity
left a comment
There was a problem hiding this comment.
Yeah, this doesn't affect 3.14, so we shouldn't backport it there.
@yihong0618 After this is merged, would you mind creating a PR to 3.14 with the test from this PR?
yihong0618
commented
Oct 15, 2025
of course with pleasure to do it thank you |
Uh oh!
There was an error while loading. Please reload this page.
vstinner
commented
Oct 15, 2025
Why not backporting this change to 3.14? |
ZeroIntensity
commented
Oct 15, 2025
On 3.14, we don't execute atexit callbacks in a loop, so if |
…s during finalization (pythonGH-140103) This fixes a regression introduced by pythonGH-136004, in which finalization would hang while executing atexit handlers if the system was out of memory. --------- Signed-off-by: yihong0618 <zouzou0208@gmail.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
fix the error that's forget the cleanup
cc @ZeroIntensity@picnixz and it also turns out its not the _testcapi_setnomemroy(0) issue.
seems the news can skip?
after this patch no hang anymore