Skip to content

[Fix] Stackoverflow in BlockSparseArray constructor with wrong number of axes #109

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
Apr 28, 2025

Conversation

lkdvos
Copy link
Contributor

@lkdvos lkdvos commented Apr 28, 2025

Fixes #108

using BlockSparseArrays
a = BlockSparseArray{Float64,2,Matrix{Float64}}(undef, ([2, 2], [2, 2])) # works
a = BlockSparseArray{Float64,2,Matrix{Float64}}(undef, ([2, 2],)) # should error - instead hangs indefinitely

By explicitly checking the length and throwing an error.
The alternative would be to simply restrict that constructor to only take length N tuples, which would throw a MethodError instead.

Copy link

codecov bot commented Apr 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.07%. Comparing base (3ba5eca) to head (f64112b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #109      +/-   ##
==========================================
+ Coverage   75.04%   75.07%   +0.02%     
==========================================
  Files          27       27              
  Lines        1062     1063       +1     
==========================================
+ Hits          797      798       +1     
  Misses        265      265              
Flag Coverage Δ
docs 16.63% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mtfishman
Copy link
Member

Thanks!

@mtfishman mtfishman merged commit 3b2ca3c into main Apr 28, 2025
19 checks passed
@mtfishman mtfishman deleted the stackoverflow branch April 28, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Stackoverflow for BlockSparseArray constructor with wrong number of axis.
2 participants