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 use-after-free error in npy_hashtable.cpp #27955

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

ngoldbaum
Copy link
Member

Fixes #27953.

Those Py_GIL_DISABLED ifdefs clearly confused me.

@ngoldbaum ngoldbaum added 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) 09 - Backport-Candidate PRs tagged should be backported labels Dec 9, 2024
@ngoldbaum ngoldbaum added this to the 2.2.1 release milestone Dec 9, 2024
@ngoldbaum
Copy link
Member Author

This fixes a universal segfault (on some platforms, others don't notice) on the free-threaded build on 2.2.0, so it would be nice to get an emergency 2.2.1 out with this applied. ping @charris sorry for the hassle!

@seberg seberg merged commit d5a080d into numpy:main Dec 9, 2024
67 checks passed
@seberg
Copy link
Member

seberg commented Dec 9, 2024

2.2.1 will happen pretty soon anyway, is it important enough to push out something before other fixes come in? (assuming they do)

@ngoldbaum
Copy link
Member Author

I'm not sure how annoying it is. We'll see if more reports come in on non-debug builds.

@seberg
Copy link
Member

seberg commented Dec 9, 2024

I suppose sklearn, etc. might also have CI with this, let's see.

charris pushed a commit to charris/numpy that referenced this pull request Dec 9, 2024
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Dec 9, 2024
charris added a commit that referenced this pull request Dec 10, 2024
BUG: fix use-after-free error in npy_hashtable.cpp (#27955)
mroeschke added a commit to mroeschke/pandas that referenced this pull request Dec 16, 2024
@mroeschke
Copy link
Contributor

In pandas we're also experiencing segfaults in our free threading, numpy 2.2 CI test build e.g. https://github.com/pandas-dev/pandas/actions/runs/12325213660/job/34404155884?pr=60562. The tests that were failing were calling numpy.vectorize and numpy.frompyfunc

I tried running the same build with the numpy nightly and it's passing now pandas-dev/pandas#60582, so I assume that this PR fixed our issues

mroeschke added a commit to pandas-dev/pandas that referenced this pull request Dec 16, 2024
…0 segfaults (#60582)

* Check if numpy/numpy#27955 fixes free-threading build

* Add comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
00 - Bug 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Python (debug mode+free threading) segfaults at exit since Numpy 2.2.0
4 participants