Skip to content
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-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c #121136

Merged
merged 1 commit into from
Jun 28, 2024
Merged

gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c #121136

merged 1 commit into from
Jun 28, 2024

Conversation

Legoclones
Copy link
Contributor

@Legoclones Legoclones commented Jun 28, 2024

In the load_additems function of Modules/_pickle.c (which handles the ADDITEMS opcode), PyObject_GetAttr is called and returns add_func on line 6660. PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so 2x calls to this function are added (compare to do_append function in the same file).

PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so 2x calls to this function are added
@gaogaotiantian gaogaotiantian changed the title Update _pickle.c gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c Jun 28, 2024
Copy link
Member

@gaogaotiantian gaogaotiantian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No user observable changes so I skipped the news.

@gaogaotiantian gaogaotiantian added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Jun 28, 2024
@gaogaotiantian gaogaotiantian merged commit 92893fd into python:main Jun 28, 2024
40 checks passed
@miss-islington-app
Copy link

Thanks @Legoclones for the PR, and @gaogaotiantian for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 28, 2024
…pickle.c (pythonGH-121136)

PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added
(cherry picked from commit 92893fd)

Co-authored-by: Justin Applegate <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 28, 2024
…pickle.c (pythonGH-121136)

PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added
(cherry picked from commit 92893fd)

Co-authored-by: Justin Applegate <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Jun 28, 2024

GH-121139 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jun 28, 2024
@bedevere-app
Copy link

bedevere-app bot commented Jun 28, 2024

GH-121140 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Jun 28, 2024
@gaogaotiantian
Copy link
Member

Thank you for fixing this!

gaogaotiantian pushed a commit that referenced this pull request Jun 28, 2024
…_pickle.c (GH-121136) (#121139)

gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c (GH-121136)

PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added
(cherry picked from commit 92893fd)

Co-authored-by: Justin Applegate <[email protected]>
gaogaotiantian pushed a commit that referenced this pull request Jun 28, 2024
…_pickle.c (GH-121136) (#121140)

gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c (GH-121136)

PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added
(cherry picked from commit 92893fd)

Co-authored-by: Justin Applegate <[email protected]>
mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
…pickle.c (python#121136)

PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
…pickle.c (python#121136)

PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
…pickle.c (python#121136)

PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants