Skip to content

[3.10] [3.11] gh-99952: fix refcount issues in ctypes.Structure from_param() result (GH-101339) #101340

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

Merged
merged 2 commits into from
Feb 4, 2023

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jan 26, 2023

[3.11] gh-99952: [ctypes] fix refcount issues in from_param() result. (GH-100169)

Fixes a reference counting issue with ctypes.Structure when a from_param() method call is used and the structure size is larger than a C pointer sizeof(void*).

This problem existed for a very long time, but became more apparent in 3.8+ by change likely due to garbage collection cleanup timing changes..
(cherry picked from commit dfad678)

(cherry picked from commit fa7c37a)

Co-authored-by: Gregory P. Smith [email protected]
Co-authored-by: Yukihiro Nakadaira [email protected]

Automerge-Triggered-By: GH:gpshead

…aram() result (pythonGH-101339)

[3.11] pythongh-99952: [ctypes] fix refcount issues in from_param() result. (pythonGH-100169)

Fixes a reference counting issue with `ctypes.Structure` when a `from_param()` method call is used and the structure size is larger than a C pointer `sizeof(void*)`.

This problem existed for a very long time, but became more apparent in 3.8+ by change likely due to garbage collection cleanup timing changes..
(cherry picked from commit dfad678)

(cherry picked from commit fa7c37a)

Co-authored-by: Gregory P. Smith <[email protected]>
Co-authored-by: Yukihiro Nakadaira <[email protected]>
@miss-islington
Copy link
Contributor Author

Sorry, I can't merge this PR. Reason: 3 of 6 required status checks are expected..

@gpshead gpshead merged commit b134978 into python:3.10 Feb 4, 2023
@miss-islington miss-islington deleted the backport-fa7c37a-3.10 branch February 4, 2023 20:09
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
None yet
Development

Successfully merging this pull request may close these issues.

4 participants