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

BUG: fix reference counting error in wrapping_method_resolve_descriptors #26190

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

ngoldbaum
Copy link
Member

It looks like this copy/paste error has been here for two years!

This was found in the nogil python build, which may find other reference counting bugs that a more forgiving GIL implementation wasn't bothered by.

@ngoldbaum ngoldbaum added the 09 - Backport-Candidate PRs tagged should be backported label Apr 1, 2024
@ngoldbaum
Copy link
Member Author

The nogil build stores the reference counts in a different spot in the PyObject struct and the reference counting logic is a bit more complicated, so it touches more places in memory than the old logic did. I think it was just dumb luck that we didn't seg fault with older python versions but now that python's reference counting internals changed we're finally getting in trouble for this bug.

@charris charris merged commit 3c9141b into numpy:main Apr 1, 2024
63 checks passed
@charris
Copy link
Member

charris commented Apr 1, 2024

Thanks Nathan.

@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Apr 2, 2024
@rgommers rgommers added this to the 2.1.0 release milestone Apr 2, 2024
@rgommers rgommers added the 39 - no-GIL PRs and issues related to support for free-threaded CPython (a.k.a. no-GIL, PEP 703) label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
00 - Bug 39 - no-GIL PRs and issues related to support for free-threaded CPython (a.k.a. no-GIL, PEP 703)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants