Bug with dot() reported by Julia console

I have found that the simple operation of dot product using dot() is leading to a the julia program (v1.5.3) crashing. I think it is a serious bug. The following simple command

using LinearAlgebra;
N = 20000; t1= rand(Complex{Float64}, N); t2= rand(Complex{Float64}, N); t1./=sqrt(N); t2./=sqrt(N); 
dot(t1, t2)

immediately leads to

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0xe submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATIONEXCEPTION_ACCESS_VIOLATION at 0xION_ACCESS_VIOLATION  with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0xION_ACCESS_VIOLATION  with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0xION_ACCESS_VIOLATION  with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0xION_ACCESS_VIOLATION  with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0xION_ACCESS_VIOLATION  with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d3d7280 --  at 0x1d3d7280 --  at 0x1d3d7280 --  at 0x1d3d7280 --  at 0x1d3d7280 --  at 0x1d3d7280 --  at 0x1d3d7280 --  at 0x1d3d7280 -- dcabs164_ at C:\Users\iamsu\AppData\Local\julia-1.5.3\bin\libopenblas64_.DLL (unknown line)
in expression starting at REPL[70]:1
 cal\julia-1.5.3\bin\libopenblas64_.DLL (unknown line)
in expression starting at REPL[70]:1
in expression starting at REPL[70]:1
 cal\julia-1.5.3\bin\libopenblas64_.DLL (unknown line)
in expression starting at REPL[70]:1
in expression starting at REPL[70]:1
 cal\julia-1.5.3\bin\libopenblas64_.DLL (unknown line)
in expression starting at REPL[70]:1
in expression starting at REPL[70]:1
dcabs164_ at C:\Users\iamsu\AppData\Local\julia-1.5.3\bin\libopenblas64_.DLL (unknown line)
in expression starting at REPL[70]:1
in expression starting at REPL[70]:1
 cal\julia-1.5.3\bin\libopenblas64_.DLL (unknown line)
dcabs164_ at C:\Users\iamsu\AppData\Local\julia-1.5.3\bin\libopenblas64_.DLL (unknown line)
in expression starting at REPL[70]:1
 cal\julia-1.5.3\bin\libopenblas64_.DLL (unknown line)
in expression starting at REPL[70]:1
OPENBLAS_GET_PARALLEL64_ at C:\Users\iamsu\AppData\Local\julia-1.5.3\bin\libopenblas64_.DLL (unknown line)
OPENBLAS_GET_PARALLEL64_ at C:\Users\iamsu\AppData\Local\julia-1.5.3\bin\libopenblas64_.DLL (unknown line)
openblas_set_num_threads64_ at C:\Users\iamsu\AppData\Local\julia-1.5.3\bin\libopenblas64_.DLL (unknown line)
dcabs164_ at C:\Users\iamsu\AppData\Local\julia-1.5.3\bin\libopenblas64_.DLL (unknown line)
cblas_zdotc_sub64_ at C:\Users\iamsu\AppData\Local\julia-1.5.3\bin\libopenblas64_.DLL (unknown line)
dotc at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\blas.jl:337 [inlined]
dotc at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\blas.jl:377
dot at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\matmul.jl:10
unknown function (ip: 000000006ea5e13d)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1690 [inlined]
do_call at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:117
eval_value at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:206

and then the window closes.

This looks like Dot abruptly ends Julia session - #4 by jhat, note also the issue linked there EXCEPTION_ACCESS_VIOLATION in julia 1.5 · Issue #36976 · JuliaLang/julia · GitHub

The GitHub discussion suggests this should be fixed in 1.6.1, although I can still reproduce this on Win 10:

julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)

julia> using LinearAlgebra

julia> N = 11_000; t1= rand(Complex{Float64}, N); t2= rand(Complex{Float64}, N);

julia> dot(t1, t2)

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1fe308e0

It seems that I’m still on the older OpenBLAS version, despite being on 1.6.1:

julia> LinearAlgebra.BLAS.openblas_get_config()
"OpenBLAS 0.3.10  USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=32"
1 Like

Oh I see… Thank you very much for looking into the matter.
My BLAS is 0.3.9.

julia> LinearAlgebra.BLAS.openblas_get_config()
"OpenBLAS 0.3.9  USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=32"

One curious thing is that, if I resize the vectors to NX1 matrices, the bug is avoiuded !

N = 20000; t1= rand(Complex{Float64}, N,1); t2= rand(Complex{Float64}, N,1 ); t1./=sqrt(N); t2./=sqrt(N); t1'*t2
1×1 Array{Complex{Float64},2}:
 0.4975290261225185 + 0.00029390224327662385im

Is there a way to update the BLAS ?

I think in principle yes, not sure how to do it though, you could move to MKL I guess by installing MKL.jl