8000 BUG: partially revert gh-28154 by ngoldbaum · Pull Request #28198 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: partially revert gh-28154 #28198

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

Closed
wants to merge 1 commit into from

Conversation

ngoldbaum
Copy link
Member

Fixes #28190.

Partially reverts gh-28154, in particular the changes to the no-descriptor, array operand, and is byteswapped codepaths that structured arrays are affected by.

}
if (in_descr) {
else if (in_descr && !PyArray_ISNBO(in_descr->byteorder)) {
PyArray_DESCR_REPLACE_CANONICAL(in_descr);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we go all the way back and not use PyArray_DESCR_REPLACE_CANONICAL for backport?
(Basically, just adding the extra !PyArray_ISNBO(in_descr->byteorde).

But if not, this looks fine. It'll solve the crash-regression for sure, thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes more sense to do to the 2.2.x branch than to main. I'd rather use ensure_canonical in more places. I'll just go ahead and make another PR to the stable branch with the minimal change, just in case there are other structured dtype breakages that didn't get so quickly reported.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #28201

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, but that means you need to make a different/dedicated backport PR against 2.2.x? (If I think about it again, for main we could potentially keep the code exactly as is, the bug may be only in searchsorted (the bug being that the dtype passed in may be replaced, so one cannot keep using it).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks for the backport. I'll have another look at searchsorted, maybe we can just fix it up there (and maybe add a brief release note just in case).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Feel free to close this if you come up with an alternate fix.

@ngoldbaum ngoldbaum removed the 09 - Backport-Candidate PRs tagged should be backported label Jan 20, 2025
@ngoldbaum ngoldbaum added this to the 2.3.0 release milestone Feb 4, 2025
@ngoldbaum ngoldbaum added the 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) label Feb 4, 2025
@ngoldbaum
Copy link
Member Author

Closing in favor of #28418

@ngoldbaum ngoldbaum closed this Mar 3, 2025
@ngoldbaum ngoldbaum removed this from the 2.3.0 release milestone Mar 3, 2025
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: np.searchsorted segfaults on structured arrays in 2.2.2
2 participants
0