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-92930: _pickle.c: Acquire strong references before calling save() #92931
Conversation
LGTM. There may be a similar issue in batch_list_exact
. Do you mind to fix it in the same PR?
There is also a suspicious place in load_build
. I am not sure that it is reproducible.
I couldn't figure out how to make a crashing test for The reason that Is it worth adding |
What if |
You're right, here's a test case that segfaults: import pickle
import io
class P(pickle.Pickler):
def persistent_id(self, obj):
if obj is a[0]:
a.clear()
return None
a = [[[[]]]]
P(io.BytesIO()).dump(a) Updating the PR soon. |
Misc/NEWS.d/next/Core and Builtins/2022-05-18-18-34-45.gh-issue-92930.kpYPOb.rst
Outdated
Show resolved
Hide resolved
No refleaks
|
Thanks @sweeneyde for the PR |
…ave() (pythonGH-92931) (cherry picked from commit 4c496f1) Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
GH-93707 is a backport of this pull request to the 3.11 branch. |
…ave() (pythonGH-92931) (cherry picked from commit 4c496f1) Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
GH-93708 is a backport of this pull request to the 3.10 branch. |
#92930