could not load symbol error for LU or QR factorizations on Julia 1.13 or newer with multithreading
Hi,
I'm seeing an error when trying to perform LU or QR factorization on multiple threads in parallel with Julia 1.13. I don't see the error on 1.12 or earlier. The error only occurs the first time the code below (a MWE) is called.
Julia 1.13
```julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.13.0-alpha2 (2025-11-30)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org release
|__/ |
julia> using LinearAlgebra, SparseArrays
julia> Base.@sync for i in 1:2
Base.Threads.@spawn lu(sprand(Complex{Float64},2,2,1.0))
end
ERROR: TaskFailedException
nested task error: could not load symbol "umfpack_zl_defaults":
/home/kevin/.julia/juliaup/julia-1.13.0-alpha2+0.x64.linux.gnu/bin/../lib/julia/libjulia-internal.so.1.13: undefined symbol: umfpack_zl_defaults
Stacktrace:
[1] umfpack_zl_defaults
@ ~/.julia/juliaup/julia-1.13.0-alpha2+0.x64.linux.gnu/share/julia/stdlib/v1.13/SparseArrays/src/solvers/wrappers.jl:2474 [inlined]
[2] get_umfpack_control
@ ~/.julia/juliaup/julia-1.13.0-alpha2+0.x64.linux.gnu/share/julia/stdlib/v1.13/SparseArrays/src/solvers/umfpack.jl:1040 [inlined]
[3] lu
@ ~/.julia/juliaup/julia-1.13.0-alpha2+0.x64.linux.gnu/share/julia/stdlib/v1.13/SparseArrays/src/solvers/umfpack.jl:369 [inlined]
[4] (::var"#2#3")()
@ Main ./REPL[1]:2
Stacktrace:
[1] sync_end(c::Channel{Any})
@ Base ./task.jl:630
[2] top-level scope
@ REPL[1]:1
[3] macro expansion
@ task.jl:663 [inlined]
```
If I call a function first that loads the library, I don't see the error.
```julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.13.0-alpha2 (2025-11-30)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org release
|__/ |
julia> using LinearAlgebra, SparseArrays
julia> SparseArrays.UMFPACK.get_umfpack_control(Complex{Float64},Int64);
julia> Base.@sync for i in 1:2
Base.Threads.@spawn lu(sprand(Complex{Float64},2,2,1.0))
end
julia>
```
Similar behavior for QR factorization and on nightly. No error on 1.12.
```julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.13.0-alpha2 (2025-11-30)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org release
|__/ |
julia> using LinearAlgebra, SparseArrays
julia> Base.@sync for i in 1:2
Base.Threads.@spawn qr(sprand(Complex{Float64},2,2,1.0))
end
ERROR: TaskFailedException
nested task error: could not load symbol "SuiteSparseQR_C":
/home/kevin/.julia/juliaup/julia-1.13.0-alpha2+0.x64.linux.gnu/bin/../lib/julia/libjulia-internal.so.1.13: undefined symbol: SuiteSparseQR_C
Stacktrace:
[1] SuiteSparseQR_C(ordering::Int32, tol::Float64, econ::Int64, getCTX::Int64, A::SparseArrays.CHOLMOD.Sparse{…}, Bsparse::Ptr{…}, Bdense::Ptr{…}, Zsparse::Ptr{…}, Zdense::Ptr{…}, R::Base.RefValue{…}, E::Base.RefValue{…}, H::Base.RefValue{…}, HPinv::Base.RefValue{…}, HTau::Base.RefValue{…}, cc::Base.RefValue{…})
@ SparseArrays.LibSuiteSparse ~/.julia/juliaup/julia-1.13.0-alpha2+0.x64.linux.gnu/share/julia/stdlib/v1.13/SparseArrays/src/solvers/wrappers.jl:2167
[2] _qr!(ordering::Int32, tol::Float64, econ::Int64, getCTX::Int64, A::SparseArrays.CHOLMOD.Sparse{…}, Bsparse::Ptr{…}, Bdense::Ptr{…}, Zsparse::Ptr{…}, Zdense::Ptr{…}, R::Base.RefValue{…}, E::Base.RefValue{…}, H::Base.RefValue{…}, HPinv::Base.RefValue{…}, HTau::Base.RefValue{…})
@ SparseArrays.SPQR ~/.julia/juliaup/julia-1.13.0-alpha2+0.x64.linux.gnu/share/julia/stdlib/v1.13/SparseArrays/src/solvers/spqr.jl:55
[3] qr(A::SparseMatrixCSC{ComplexF64, Int64}; tol::Float64, ordering::Int32)
@ SparseArrays.SPQR ~/.julia/juliaup/julia-1.13.0-alpha2+0.x64.linux.gnu/share/julia/stdlib/v1.13/SparseArrays/src/solvers/spqr.jl:203
[4] qr(A::SparseMatrixCSC{ComplexF64, Int64})
@ SparseArrays.SPQR ~/.julia/juliaup/julia-1.13.0-alpha2+0.x64.linux.gnu/share/julia/stdlib/v1.13/SparseArrays/src/solvers/spqr.jl:195
[5] (::var"#2#3")()
@ Main ./REPL[1]:2
Stacktrace:
[1] sync_end(c::Channel{Any})
@ Base ./task.jl:630
[2] top-level scope
@ REPL[1]:1
[3] macro expansion
@ task.jl:663 [inlined]
Some type information was truncated. Use `show(err)` to see complete types.
```
Interestingly, I don't see the error with KLU.jl.
```julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.13.0-alpha2 (2025-11-30)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org release
|__/ |
julia> using LinearAlgebra, SparseArrays, KLU
julia> Base.@sync for i in 1:2
Base.Threads.@spawn klu(sprand(Complex{Float64},2,2,1.0))
end
julia>
```
If this is a bug in Julia, let me know and I can make an issue in that repo instead.
6 条评论