-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
gh-140080: Fix atexit with low memory #140103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-140080: Fix atexit with low memory #140103
Conversation
Signed-off-by: yihong0618 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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? |
Let's do that in a different PR, because we'll want that in 3.14 as well. |
ok will do it later, thank you for the help~ |
Signed-off-by: yihong0618 <[email protected]>
Done, before the patch the tests hangs tests from #138491 |
Misc/NEWS.d/next/Core_and_Builtins/2025-10-14-20-18-31.gh-issue-140080.8ROjxW.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Peter Bierma <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
FYI: 3.14 not hang |
Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
of course with pleasure to do it thank you |
Why not backporting this change to 3.14? |
On 3.14, we don't execute atexit callbacks in a loop, so if |
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