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

Prevent integer overflow for large sparse matrices on 32-bit systems. #37840

Merged
merged 2 commits into from
Oct 27, 2020

Conversation

eschnett
Copy link
Contributor

@eschnett eschnett commented Oct 1, 2020

The length of a sparse array can be very large, even when the number of stored elements is small.

  • Add internal "widelength" function for sparse arrays that always uses Int64
  • Use it when comparing lenghts
  • Add respective tests

Closes #37819.

@omus omus added system:32-bit Affects only 32-bit systems domain:arrays:sparse Sparse arrays labels Oct 1, 2020
The length of a sparse array can be very large, even when the number of stored elements is small.
- Add internal "widelength" function for sparse arrays that always uses Int64
- Use it when comparing lenghts
- Add respective tests
@eschnett
Copy link
Contributor Author

eschnett commented Oct 2, 2020

The failures are unrelated. The relevant test case SparseArrays/higherorderfns succeeded in all runs above. In particular, the relevant 32-bit test suites all succeeded.

Copy link
Member

@dkarrasch dkarrasch left a comment

Choose a reason for hiding this comment

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

LGTM.

@eschnett
Copy link
Contributor Author

Ping?

@dkarrasch dkarrasch merged commit 03c5eee into JuliaLang:master Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:arrays:sparse Sparse arrays system:32-bit Affects only 32-bit systems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sparse matrix map broken for large matrices on 32-bit systems
3 participants