Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OverflowError when splatting array of arrays #11884

Closed
andreasnoack opened this issue Jun 26, 2015 · 5 comments
Closed

OverflowError when splatting array of arrays #11884

andreasnoack opened this issue Jun 26, 2015 · 5 comments

Comments

@andreasnoack
Copy link
Member

The test vector is from Metis.jl. The bug can be seen from the sequence

julia> using Metis

julia> copter2 = Metis.testgraph("copter2")
Undirected Graph (55476 vertices, 352238 edges)

julia> typeof(copter2.adjlist)
Array{Array{Int32,1},1}

julia> vcat(copter2.adjlist...);
ERROR: OverflowError()

julia> vcat(copter2.adjlist[1:100]...);

julia> vcat(copter2.adjlist...); # works!
@yuyichao
Copy link
Contributor

Ref #11320 #11330

@ScottPJones
Copy link
Contributor

Yes, much better behavior than before @yuyichao fixed it so quickly! (Thanks again!)

@ScottPJones
Copy link
Contributor

Is it something strange in the GC that it can work the 2nd time? Before the fixes, the first call would have hung julia.

@yuyichao
Copy link
Contributor

And just to give a example that doesn't depend on external packages.

julia> ary = [[1, 2] for i in 1:100000];

julia> vcat(ary...);
ERROR: OverflowError()

julia> vcat(ary[1:100]...);

julia> vcat(ary...);

@andreasnoack
Copy link
Member Author

@JeffBezanson suggests avoiding the splatting when doing this in favor of doing something like https://github.com/JuliaSparse/Metis.jl/blob/b675ea7adfb8d5230814757d8f08bfce63a42e02/src/util.jl#L1-L8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants