Skip to content

BUG: Fix segfault in stringdtype lexsort #27992

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 3 commits into from
Dec 13, 2024

Conversation

ngoldbaum
Copy link
Member

Fixes #27984

The segfault was happening because REFCHK is not a sufficient condition anymore (if it ever was) to assume the GIL is held. The fix is to use the check that was already happening to see if the dtype has NEEDS_PYAPI set.

Also adds tests for both stringdtype argsort and string lexsort.

@ngoldbaum ngoldbaum added the 09 - Backport-Candidate PRs tagged should be backported label Dec 12, 2024
@ngoldbaum ngoldbaum force-pushed the fix-stringdtype-lexsort branch from f09c44f to a47da94 Compare December 12, 2024 20:59
@charris charris merged commit 6377468 into numpy:main Dec 13, 2024
66 checks passed
@charris
Copy link
Member

charris commented Dec 13, 2024

Thanks Nathan.

charris pushed a commit to charris/numpy that referenced this pull request Dec 13, 2024
* BUG: do not assume REFCHK is the same as object in lexsort

* TST: add tests for stringdtype argsort

* TST: add tests for string lexsort
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: lexsort segfaults on StringDType
2 participants