Skip to content

LAPACK error arrising from PyPlot #506

@PhillipBC

Description

@PhillipBC

Hi,

This problem first arose using Julia 1.4.2, and I then changed to version 1.5.1 and the problem was still there.

If I create a matrix, then get its eigenvalues, then plot a histogram of the eigenvalues, then get the eigenvalues again, I get the error:

** On entry to DGEBAL parameter number  3 had an illegal value
 ** On entry to DGEHRD  parameter number  2 had an illegal value
 ** On entry to DHSEQR parameter number  4 had an illegal value
ArgumentError: invalid argument #4 to LAPACK call
Stacktrace:
 [1] chklapackerror at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\lapack.jl:36 [inlined]
 [2] geevx!(::Char, ::Char, ::Char, ::Char, ::Array{Float64,2}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\lapack.jl:2082
 [3] eigvals!(::Array{Float64,2}; permute::Bool, scale::Bool, sortby::typeof(LinearAlgebra.eigsortby)) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\eigen.jl:293
 [4] eigvals! at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\eigen.jl:292 [inlined]
 [5] #eigvals#73 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\eigen.jl:326 [inlined]
 [6] eigvals(::Array{Float64,2}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\eigen.jl:326
 [7] top-level scope at F:\MEGA\Julia_Code\00_Temperature\errorfind.jl:10

Below is a minimum working example that causes the error:

using LinearAlgebra
using PyCall
using PyPlot

D = 1000
M = randn(D,D)
ei = real(eigvals(M))
PyPlot.hist(ei)

Then call the eigensolver again

ei = real(eigvals(M))

Gives:

** On entry to DGEBAL parameter number  3 had an illegal value
 ** On entry to DGEHRD  parameter number  2 had an illegal value
 ** On entry to DHSEQR parameter number  4 had an illegal value
ERROR: ArgumentError: invalid argument #4 to LAPACK call
Stacktrace:
 [1] chklapackerror at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\lapack.jl:36 [inlined]
 [2] geevx!(::Char, ::Char, ::Char, ::Char, ::Array{Float64,2}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\lapack.jl:2082
 [3] eigvals!(::Array{Float64,2}; permute::Bool, scale::Bool, sortby::typeof(LinearAlgebra.eigsortby)) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\eigen.jl:293
 [4] eigvals! at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\eigen.jl:292 [inlined]
 [5] #eigvals#73 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\eigen.jl:326 [inlined]
 [6] eigvals(::Array{Float64,2}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\eigen.jl:326
 [7] top-level scope at none:1

I originally posted about the error on Julia discourse: ArgumentError: invalid argument #4 to LAPACK call back in September.

As you will see there, one can also reproduce the error using Plots.jl with the pyplot() backend.

Version Info:

Julia Version 1.5.1
Commit 697e782ab8 (2020-08-25 20:08 UTC)       
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions