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

Stackoverflow with broadcast += between Vector and scalar*BlockedVector #411

Open
DanielVandH opened this issue Jul 29, 2024 · 0 comments
Open

Comments

@DanielVandH
Copy link

DanielVandH commented Jul 29, 2024

julia> using BlockArrays

julia> A = BlockedVector(1:6, [3, 2, 1]);

julia> B = zeros(6);

julia> @. B += A; # fine

julia> @. B += 1A; # broken. @. B + 1A works fine though.
ERROR: StackOverflowError:
Stacktrace:
     [1] Array
       @ .\boot.jl:477 [inlined]
     [2] Array
       @ .\boot.jl:496 [inlined]
     [3] emptymutable
       @ .\abstractarray.jl:899 [inlined]
     [4] union
       @ .\abstractset.jl:57 [inlined]
     [5] sortedunion(a::Vector{Int64}, b::FillArrays.Fill{Int64, 1, Tuple{Base.OneTo{Int64}}})
       @ BlockArrays C:\Users\danjv\.julia\packages\BlockArrays\xi4on\src\blockbroadcast.jl:34
     [6] combine_blockaxes
       @ C:\Users\danjv\.julia\packages\BlockArrays\xi4on\src\blockbroadcast.jl:37 [inlined]
     [7] axistype
       @ C:\Users\danjv\.julia\packages\BlockArrays\xi4on\src\blockbroadcast.jl:41 [inlined]
     [8] _bcs1(a::Base.OneTo{Int64}, b::BlockedOneTo{Int64, Vector{Int64}})
       @ Base.Broadcast .\broadcast.jl:555
     [9] _bcs
       @ .\broadcast.jl:549 [inlined]
    [10] broadcast_shape
       @ .\broadcast.jl:543 [inlined]
    [11] combine_axes
       @ .\broadcast.jl:524 [inlined]
    [12] _axes
       @ .\broadcast.jl:236 [inlined]
    [13] axes
       @ .\broadcast.jl:234 [inlined]
    [14] materialize!
       @ C:\Users\danjv\.julia\packages\BlockArrays\xi4on\src\blockbroadcast.jl:128 [inlined]
    [15] broadcast!(::typeof(+), ::SubArray{…}, ::SubArray{…}, ::Base.Broadcast.Broadcasted{…})
       @ Base.Broadcast .\broadcast.jl:880
    [16] _fast_blockbradcast_copyto!
       @ C:\Users\danjv\.julia\packages\BlockArrays\xi4on\src\blockbroadcast.jl:173 [inlined]
    [17] copyto!(dest::SubArray{…}, bc::Base.Broadcast.Broadcasted{…})
       @ BlockArrays C:\Users\danjv\.julia\packages\BlockArrays\xi4on\src\blockbroadcast.jl:192
    [18] materialize!
       @ C:\Users\danjv\.julia\packages\BlockArrays\xi4on\src\blockbroadcast.jl:131 [inlined]
--- the last 4 lines are repeated 7911 more times ---
 [31663] broadcast!(::typeof(+), ::SubArray{…}, ::SubArray{…}, ::Base.Broadcast.Broadcasted{…})
       @ Base.Broadcast .\broadcast.jl:880
 [31664] _fast_blockbradcast_copyto!(dest::Vector{…}, bc::Base.Broadcast.Broadcasted{…})
       @ BlockArrays C:\Users\danjv\.julia\packages\BlockArrays\xi4on\src\blockbroadcast.jl:173
 [31665] copyto!(dest::Vector{…}, bc::Base.Broadcast.Broadcasted{…})
       @ BlockArrays C:\Users\danjv\.julia\packages\BlockArrays\xi4on\src\blockbroadcast.jl:192
Some type information was truncated. Use `show(err)` to see complete types.
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

No branches or pull requests

1 participant