Skip to content

BUG: fix double evaluation in PyArrayScalar_RETURN_BOOL_FROM_LONG#30418

Merged
seberg merged 2 commits intonumpy:mainfrom
y7070:fix/double_eval_in_PyArrayScalar_RETURN_BOOL_FROM_LONG
Dec 11, 2025
Merged

BUG: fix double evaluation in PyArrayScalar_RETURN_BOOL_FROM_LONG#30418
seberg merged 2 commits intonumpy:mainfrom
y7070:fix/double_eval_in_PyArrayScalar_RETURN_BOOL_FROM_LONG

Conversation

@y7070
Copy link
Copy Markdown
Contributor

@y7070 y7070 commented Dec 11, 2025

Closes #30389

Copy link
Copy Markdown
Member

@ngoldbaum ngoldbaum left a comment

Choose a reason for hiding this comment

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

A couple minor comments. The C change looks correct to me.

writer.start()
reader.start()
writer.join()
reader.join()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd probably write this using ProcessPoolExecutor to avoid this boilerplate and join the processes by construction with a with statement.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it — I’ll switch to ProcessPoolExecutor so the process setup and joining are handled automatically.

@y7070 y7070 force-pushed the fix/double_eval_in_PyArrayScalar_RETURN_BOOL_FROM_LONG branch from 37d214d to 1c9a6e5 Compare December 11, 2025 17:05
@y7070
Copy link
Copy Markdown
Contributor Author

y7070 commented Dec 11, 2025

rebased the commit history to keep only one commit 🚀

@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Dec 11, 2025
@ngoldbaum
Copy link
Copy Markdown
Member

LGTM! @seberg would you mind looking at this one and merging if you agree.

@seberg
Copy link
Copy Markdown
Member

seberg commented Dec 11, 2025

I am happy if you like the test and I guess you do. I was hoping to use advanced indexing and get away with just threading but I am not exactly sure how to design them best to make sure they actually result in a crash :).

So thanks @y7070, seems fine to just put it in as is.

@seberg seberg merged commit 753dd1f into numpy:main Dec 11, 2025
78 of 79 checks passed
charris pushed a commit to charris/numpy that referenced this pull request Dec 11, 2025
…mpy#30418)

* BUG: fix double evaluation in PyArrayScalar_RETURN_BOOL_FROM_LONG

Closes numpy#30389

* fix: lint errors and wasm import problems
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Dec 11, 2025
charris added a commit that referenced this pull request Dec 12, 2025
BUG: fix double evaluation in PyArrayScalar_RETURN_BOOL_FROM_LONG (#30418)
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: [IPC] Refcount corruption and crash in boolean memmap reads due to double evaluation in PyArrayScalar_RETURN_BOOL_FROM_LONG

4 participants