Skip to content

Missing PyDECREF calls for ADDITEMS opcode of _pickle.c #121137

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

Closed
Legoclones opened this issue Jun 28, 2024 · 1 comment
Closed

Missing PyDECREF calls for ADDITEMS opcode of _pickle.c #121137

Legoclones opened this issue Jun 28, 2024 · 1 comment
Labels
type-bug An unexpected behavior, bug, or error

Comments

@Legoclones
Copy link
Contributor

Legoclones commented Jun 28, 2024

Bug report

Bug description:

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).

Pull request was made at #121136

CPython versions tested on:

3.11

Operating systems tested on:

Linux

Linked PRs

@Legoclones Legoclones added the type-bug An unexpected behavior, bug, or error label Jun 28, 2024
gaogaotiantian pushed a commit that referenced this issue Jun 28, 2024
….c (#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
miss-islington pushed a commit to miss-islington/cpython that referenced this issue 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 issue 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]>
gaogaotiantian pushed a commit that referenced this issue 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 issue 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]>
@gaogaotiantian
Copy link
Member

Thanks for reporting and fixing this.

mrahtz pushed a commit to mrahtz/cpython that referenced this issue 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 issue 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 issue 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
Labels
type-bug An unexpected behavior, bug, or error
Projects
Status: Done
Development

No branches or pull requests

2 participants