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

Fix illegal instruction on osx-64 when returning 0 length arrays #1846

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

joaander
Copy link
Member

@joaander joaander commented Jul 17, 2024

Description

Replace &vector[0] with vector->data(). data() is undefined for 0 length vectors, so also add in a separate code path to return numpy managed arrays when they are 0 length.

Motivation and context

I don't understand why this didn't cause problems sooner. The 4.8.0 builds fail with an illegal instruction on the osx-64 platform: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=980051&view=logs&j=9c5ef928-2cd6-52e5-dbe6-9d173a7d951b&t=20c71c51-4b27-578b-485d-06ade2de1d00&l=6682

How has this been tested?

I applied this diff as a patch in a test PR and the build now passes:
https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=980708&view=logs&j=9c5ef928-2cd6-52e5-dbe6-9d173a7d951b&t=20c71c51-4b27-578b-485d-06ade2de1d00

Change log

Fixed:

* Prevent illegal instruction when accessing 0 length snapshot arrays
  (`#1846 <https://github.com/glotzerlab/hoomd-blue/pull/1846>`__)

Checklist:

@joaander joaander requested review from a team, tcmoore3, tommy-waltmann and Tobias-Dwyer and removed request for a team July 17, 2024 13:29
@joaander joaander added the validate Execute long running validation tests on pull requests label Jul 17, 2024
@joaander joaander merged commit 8e39db3 into trunk-patch Jul 18, 2024
45 of 64 checks passed
@joaander joaander deleted the fix-illegal-instruction branch July 18, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validate Execute long running validation tests on pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant