Skip to content

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 greg@krypto.org
Co-authored-by: Yukihiro Nakadaira yukihiro.nakadaira@gmail.com

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 <greg@krypto.org>
Co-authored-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com>
@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