# EXCEPTION\_ACCESS\_VIOLATION when using LinearAlgebra.jl

**URL:** <https://discourse.julialang.org/t/exception-access-violation-when-using-linearalgebra-jl/49608>\
**Category:** New to Julia\
**Tags:** linearalgebra\
**Created:** [November 4, 2020, 11:04pm UTC](https://discourse.julialang.org/t/exception-access-violation-when-using-linearalgebra-jl/49608 "2020-11-04T23:04:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JaredMcB](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jaredmcb/32/14703_2.png) [@JaredMcB](https://discourse.julialang.org/u/JaredMcB)\
**Post date:** [November 4, 2020, 11:04pm UTC](https://discourse.julialang.org/t/exception-access-violation-when-using-linearalgebra-jl/49608/1 "2020-11-04T23:04:40Z")

</div>

I noticed this problem on my machine. I am thinking it is a installation issue and am wondering what else may be affected. Thanks in advance for any insight you might give in this matter.

The problem is that julia crashes when I use the `dot` function from `LinearAlgebra.jl` on arrays of complex numbers that are longer than 10^4. If the arrays of complex numbers have of length 10001 or more, it crashes. If the arrays are real `dot` works just fine. If the arrays are complex and are less than 10001 entries `dot` works fine.

Another interesting point is that when I run the code for the dot function (found in the repository for LinearAlgebra) and use that function it works as it should in this case. So, when I run

```julia
function dot end

function dot(x, y) # arbitrary iterables
    ix = iterate(x)
    iy = iterate(y)
    if ix === nothing
        if iy !== nothing
            throw(DimensionMismatch("x and y are of different lengths!"))
        end
        return dot(zero(eltype(x)), zero(eltype(y)))
    end
    if iy === nothing
        throw(DimensionMismatch("x and y are of different lengths!"))
    end
    (vx, xs) = ix
    (vy, ys) = iy
    s = dot(vx, vy)
    while true
        ix = iterate(x, xs)
        iy = iterate(y, ys)
        ix === nothing && break
        iy === nothing && break
        (vx, xs), (vy, ys) = ix, iy
        s += dot(vx, vy)
    end
    if !(iy === nothing && ix === nothing)
        throw(DimensionMismatch("x and y are of different lengths!"))
    end
    return s
end

dot(x::Number, y::Number) = conj(x) * y

function dot(x::AbstractArray, y::AbstractArray)
    lx = length(x)
    if lx != length(y)
        throw(DimensionMismatch("first array has length $(lx) which does not match the length of the second, $(length(y))."))
    end
    if lx == 0
        return dot(zero(eltype(x)), zero(eltype(y)))
    end
    s = zero(dot(first(x), first(y)))
    for (Ix, Iy) in zip(eachindex(x), eachindex(y))
        @inbounds s += dot(x[Ix], y[Iy])
    end
    s
end

foo(n) = randn(n) + im*randn(n)

dot(foo(10^7),foo(10^7))

```

It works fine but if I run:

```julia
using LinearAlgebra: dot

foo(n) = randn(n) + im*randn(n)

dot(foo(10001),foo(10001))

```

julia crashes.

The error message I get before julia dies is here:

```julia
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:
Please submit a bug repor
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 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 -- at 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 -- at 0x1d407280 -- OLATION at 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 --

```

Here are my configurations

```julia
julia> versioninfo()
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 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)

```

I am happy to supply any other help information.  
Thank you.

---

<div class="post-metadata">

**Author:** ![rapus95](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rapus95/32/3773_2.png) [@rapus95](https://discourse.julialang.org/u/rapus95)\
**Post date:** [November 4, 2020, 11:08pm UTC](https://discourse.julialang.org/t/exception-access-violation-when-using-linearalgebra-jl/49608/2 "2020-11-04T23:08:32Z")

</div>

Can reproduce, open an issue on github! 🙂 [Issues · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues)

---

<div class="post-metadata">

**Author:** ![JaredMcB](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jaredmcb/32/14703_2.png) [@JaredMcB](https://discourse.julialang.org/u/JaredMcB)\
**Post date:** [November 4, 2020, 11:12pm UTC](https://discourse.julialang.org/t/exception-access-violation-when-using-linearalgebra-jl/49608/4 "2020-11-04T23:12:29Z")

</div>

Ok, I will. Thanks!

---

<div class="post-metadata">

**Author:** ![JaredMcB](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jaredmcb/32/14703_2.png) [@JaredMcB](https://discourse.julialang.org/u/JaredMcB)\
**Post date:** [November 4, 2020, 11:17pm UTC](https://discourse.julialang.org/t/exception-access-violation-when-using-linearalgebra-jl/49608/5 "2020-11-04T23:17:43Z")

</div>

I open an issue on github: [https://github.com/JuliaLang/julia/issues/38305](https://github.com/JuliaLang/julia/issues/38305)
