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

BoundsError in Sparspak on CI #258

Closed
fredrikekre opened this issue Jan 20, 2023 · 5 comments
Closed

BoundsError in Sparspak on CI #258

fredrikekre opened this issue Jan 20, 2023 · 5 comments

Comments

@fredrikekre
Copy link
Contributor

See https://github.com/SciML/LinearSolve.jl/actions/runs/3967886786/jobs/6800368191

ERROR: LoadError: BoundsError: attempt to access 3-element Vector{Int64} at index [4]
Stacktrace:
  [1] getindex
    @ ./array.jl:924 [inlined]
  [2] isstructuresymmetric(g::Sparspak.SpkGraph.Graph{Int64})
    @ Sparspak.SpkGraph ~/.julia/packages/Sparspak/uIYt5/src/Graph/SpkGraph.jl:336
  [3] makestructuresymmetric(g::Sparspak.SpkGraph.Graph{Int64})
    @ Sparspak.SpkGraph ~/.julia/packages/Sparspak/uIYt5/src/Graph/SpkGraph.jl:120
  [4] _findorder!(s::Sparspak.SpkSparseBase._SparseBase{Int64, Float64}, orderfunction::typeof(Sparspak.SpkMmd.mmd!))
    @ Sparspak.SpkSparseBase ~/.julia/packages/Sparspak/uIYt5/src/SparseMethod/SpkSparseBase.jl:178
  [5] _findorder!
    @ ~/.julia/packages/Sparspak/uIYt5/src/SparseMethod/SpkSparseBase.jl:184 [inlined]
  [6] findorder!
    @ ~/.julia/packages/Sparspak/uIYt5/src/SparseMethod/SpkSparseSolver.jl:120 [inlined]
  [7] sparspaklu!(lu::Sparspak.SpkSparseSolver.SparseSolver{Int64, Float64}, m::SparseArrays.SparseMatrixCSC{Float64, Int64})
    @ Sparspak.SparseCSCInterface ~/.julia/packages/Sparspak/uIYt5/src/SparseCSCInterface/SparseCSCInterface.jl:247
  [8] #solve#18
    @ ~/work/LinearSolve.jl/LinearSolve.jl/src/factorization.jl:522 [inlined]

cc @j-fu @PetrKryslUCSD

@j-fu
Copy link
Contributor

j-fu commented Jan 20, 2023

I can reproduce this at my computer, however, the error occurs randomly, i.e. sometimes it shows up, sometimes not...

First time seeing this coming up, other ways to work with sparse random matrices so far didn't show this behavior.

For the time being I propose to remove sparspak from precompilation (this is where the error occurs). I think it can be kept in the package tests, as there, different matrices are used.

Will try to find time over the WE to investigate deeper.

@ChrisRackauckas
Copy link
Member

Removed from precompilation for now.

@PetrKryslUCSD
Copy link

PetrKryslUCSD commented Jan 21, 2023

I think I found an error in the original fortran code: the graph field adj was being accessed
beyond the end of the array. I added a check on line https://github.com/PetrKryslUCSD/Sparspak.jl/blob/958744abe7f5a97a52419b928541bd4623c6f182/src/Graph/SpkGraph.jl#L336.

@PetrKryslUCSD
Copy link

Spoke too soon: Not good. Sparspak now fails in simpletest2.

@j-fu
Copy link
Contributor

j-fu commented Jan 21, 2023

Fixed with 710fc37 via PetrKryslUCSD/Sparspak.jl@2b5b685

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

No branches or pull requests

4 participants