Julia: EXCEPTION_ACCESS_VIOLATION in julia 1.5

Created on 9 Aug 2020  路  12Comments  路  Source: JuliaLang/julia

To reproduce

x = zeros(ComplexF64, 10001)
x' * x

The error message is

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  with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1a3e7280 --  at 0x1a3e7280 --  OLATION  with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1a3e7280 --  OLATION  with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1a3e7280 -- unknown function (ip: 000000001A3E7280)
in expression starting at REPL[10]:1
in expression starting at REPL[10]:1
 )
  reproduce this fault, and any error messages that follow (in their entirety). Thanks.
julia> versioninfo()
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

Does not happen on julia 1.4.2.

external dependencies linear algebra regression

Most helpful comment

I can reproduce this issue using a Fortran program with OpenBLAS v0.3.9 and v0.3.10 (master) compiled by myself on Windows. I will file it to the OpenBLAS repo.

program test_zdot
   implicit none
   integer :: n,inc
   complex*16 :: val
   complex*16,allocatable :: zx(:)

   interface
      COMPLEX*16 FUNCTION zdotc(N,ZX,INCX,ZY,INCY)
         INTEGER incx,incy,n
         COMPLEX*16 zx(*),zy(*)
      END FUNCTION zdotc
   end interface

   read(*,*) n
   allocate(zx(n))
   zx(:) = 0.0
   inc = 1
   val = zdotc(n,zx,inc,zx,inc)
   print *,val
end program test_zdot
# compilation
gfortran test_zdot.f90 libopenblas.dll.a

# okay case
$ ./a.out
10
               (0.0000000000000000,0.0000000000000000)

# current issue
10001

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0xffffffff
Segmentation fault

All 12 comments

Cannot reproduce on

julia> versioninfo()
Julia Version 1.5.0
Commit 96786e22cc* (2020-08-01 23:44 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i5-5###U CPU @ 2.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-10.0.1 (ORCJIT, broadwell)

Can you post the output of

julia> LinearAlgebra.BLAS.determine_vendor()
:openblas

julia> LinearAlgebra.BLAS.openblas_get_config()
"OpenBLAS 0.3.10 NO_LAPACK NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY USE_OPENMP Haswell MAX_THREADS=64"
julia> LinearAlgebra.BLAS.determine_vendor()
:openblas64

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

Ok, I tested on the official release, cannot reproduce either:

julia> versioninfo()
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i5-5###U CPU @ 2.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, broadwell)

julia> LinearAlgebra.BLAS.determine_vendor()
:openblas64

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

So it does appear to be a windows-specific issue. I think somebody else with access to a windows machine needs to take over here :(

It happens on Julia 1.5 or later (including nightly build) in windows with "libopenblas64_.dll" (33,470,581 bytes). This issue was solved when:

  • I replaced the DLL with the previous version (supplied in Julia 1.4.1, libopenblas64_.dll 33,747,481 bytes).
  • Or, I put LinearAlgebra.BLAS.set_num_threads(1).

The error occurred on my AMD PC as well.

julia> versioninfo()
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: AMD Ryzen 5 PRO 2400GE w/ Radeon Vega Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, znver1)

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

EDIT: Julia 1.4.1 uses older OpenBLAS.

julia> versioninfo()
Julia Version 1.4.1
Commit 381693d3df* (2020-04-14 17:20 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: AMD Ryzen 5 PRO 2400GE w/ Radeon Vega Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, znver1)

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

See also https://github.com/JuliaLang/julia/issues/36522#issuecomment-674316590 for some more debug info. @masuday would you be able to make a small Fortran repro of this and file this as an issue in the OpenBLAS repo?

@andreasnoack Sure. I will try it.

I can reproduce this issue using a Fortran program with OpenBLAS v0.3.9 and v0.3.10 (master) compiled by myself on Windows. I will file it to the OpenBLAS repo.

program test_zdot
   implicit none
   integer :: n,inc
   complex*16 :: val
   complex*16,allocatable :: zx(:)

   interface
      COMPLEX*16 FUNCTION zdotc(N,ZX,INCX,ZY,INCY)
         INTEGER incx,incy,n
         COMPLEX*16 zx(*),zy(*)
      END FUNCTION zdotc
   end interface

   read(*,*) n
   allocate(zx(n))
   zx(:) = 0.0
   inc = 1
   val = zdotc(n,zx,inc,zx,inc)
   print *,val
end program test_zdot
# compilation
gfortran test_zdot.f90 libopenblas.dll.a

# okay case
$ ./a.out
10
               (0.0000000000000000,0.0000000000000000)

# current issue
10001

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0xffffffff
Segmentation fault

FYI: A workaround is to use OPENBLAS_CORETYPE=Nehalem.

This issue was fixed (https://github.com/xianyi/OpenBLAS/pull/2791). Probably the next version of OpenBLAS ships this fix.

Great. Thanks for following through.

This problem was fixed in OpenBLAS 0.3.12. I confirmed the above Fortran MWE worked with the new OpenBLAS but I haven't try Julia.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omus picture omus  路  3Comments

dpsanders picture dpsanders  路  3Comments

ararslan picture ararslan  路  3Comments

i-apellaniz picture i-apellaniz  路  3Comments

sbromberger picture sbromberger  路  3Comments