# Sparse array problem: is this a known bug?

**URL:** https://discourse.julialang.org/t/sparse-array-problem-is-this-a-known-bug/18032
**Category:** Performance
**Created:** [November 26, 2018, 8:13pm UTC](https://discourse.julialang.org/t/sparse-array-problem-is-this-a-known-bug/18032 "2018-11-26T20:13:15Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![PeterB](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@PeterB](https://discourse.julialang.org/u/PeterB)
#### Post date: [November 26, 2018, 8:13pm UTC](https://discourse.julialang.org/t/sparse-array-problem-is-this-a-known-bug/18032/1 "2018-11-26T20:13:15Z")

</div>

I accidentally downloaded version 1.1.0-DEV.699 , and I think I discovered a bug with sparse arrays. So (a) is this a bug, (b) is it known by the developers, and (c) if so, where do I report it. (and (d), and I am the correct page of this forum(

What happens is for simplest of array operations, array addition, I get an “invalid array dimensions” error, even though all array dimensions seem correct; and it depends on the array size.

```julia
using Printf
using SparseArrays

function test(ssize)
    M1 = spzeros(ssize, ssize)
    M2 = spzeros(ssize, ssize)
    @printf("size(M1) = %s\n", size(M1))
    @printf("size(M2) = %s\n", size(M2))
    V = M1 + M2
    @printf("size(V) = %s\n", size(V))
end

test(65679) # passes 
test(63999) # fails
#test(110233) # fails

```

Output:

```julia
$ julia stest2.jl
size(M1) = (65679, 65679)
size(M2) = (65679, 65679)
size(V) = (65679, 65679)
size(M1) = (63999, 63999)
size(M2) = (63999, 63999)
ERROR: LoadError: invalid Array dimensions

```

---

<div class="post-metadata">

### Author: ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)
#### Post date: [November 26, 2018, 10:04pm UTC](https://discourse.julialang.org/t/sparse-array-problem-is-this-a-known-bug/18032/2 "2018-11-26T22:04:39Z")

</div>

Don’t have 1.1-dev here but on 1.02 this works (as expected).

---

<div class="post-metadata">

### Author: ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)
#### Post date: [November 26, 2018, 10:13pm UTC](https://discourse.julialang.org/t/sparse-array-problem-is-this-a-known-bug/18032/3 "2018-11-26T22:13:00Z")

</div>

> [@PeterB](#):
>
> is it known by the developers, and © if so, where do I report it.

[Issues · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues) Search for similar issues first, then file it. Worst case, someone will point out that it’s a duplicate. Bug reports (especially self-contained examples like yours) are always appreciated.

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [November 26, 2018, 10:19pm UTC](https://discourse.julialang.org/t/sparse-array-problem-is-this-a-known-bug/18032/4 "2018-11-26T22:19:42Z")

</div>

On latest master commit I get

```julia
julia> test(63999) # fails
size(M1) = (63999, 63999)
size(M2) = (63999, 63999)
size(V) = (63999, 63999)

julia> test(110233) # fails
size(M1) = (110233, 110233)
size(M2) = (110233, 110233)
size(V) = (110233, 110233)

```

---

<div class="post-metadata">

### Author: ![PeterB](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@PeterB](https://discourse.julialang.org/u/PeterB)
#### Post date: [November 26, 2018, 11:24pm UTC](https://discourse.julialang.org/t/sparse-array-problem-is-this-a-known-bug/18032/5 "2018-11-26T23:24:39Z")

</div>

By “latest master commit” do you mean the latest development version, 1.1.something ? If so, I probably just stumbled on a bad one when I downloaded 1.1.0-DEV.699 (on Nov 20).

---

<div class="post-metadata">

### Author: ![tlienart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlienart/32/7640_2.png) [@tlienart](https://discourse.julialang.org/u/tlienart)
#### Post date: [November 26, 2018, 11:53pm UTC](https://discourse.julialang.org/t/sparse-array-problem-is-this-a-known-bug/18032/6 "2018-11-26T23:53:09Z")

</div>

1.1.0-DEV.720 here and I can’t reproduce the issue.

---

<div class="post-metadata">

### Author: ![PeterB](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@PeterB](https://discourse.julialang.org/u/PeterB)
#### Post date: [November 27, 2018, 1:49am UTC](https://discourse.julialang.org/t/sparse-array-problem-is-this-a-known-bug/18032/7 "2018-11-27T01:49:27Z")

</div>

OK, it must be fixed, so I won’t report.  
p.s. I downloaded stable 1.0.2 and my code (not just the toy example above) is working, which is good!
