We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Reduced from https://discourse.julialang.org/t/signal-11-segmentation-fault-11-with-differentialequations-jl/23264/:
y = sparsevec([2,7], [1., 2.], 10) x1 = sparsevec(fill(1.0, 10)) x2 = sparsevec([2,7], [1., 2.], 10) x3 = sparsevec(fill(1.0, 10)) f(x, y, z) = x == y == z == 0 ? 0.0 : NaN bc = Broadcast.broadcasted(f, x1, x2, x3) Broadcast.materialize!(y, bc)
where the last line causes a segfault (BoundsError with --check-bounds=yes). The problem is here:
BoundsError
--check-bounds=yes
julia/stdlib/SparseArrays/src/higherorderfns.jl
Line 390 in c83e312
1
1|debug> n In _map_zeropres!(f, C, As) at /julia/stdlib/v1.0/SparseArrays/src/higherorderfns.jl:372 382 while activerow < rowsentinel 383 vals, ks, rows = _fusedupdate_all(rowsentinel, activerow, rows, ks, stopks, As) 384 Cx = f(vals...) 385 if !_iszero(Cx) >386 Ck > spaceC && (spaceC = expandstorage!(C, Ck + min(length(C), _sumnnzs(As...)) - (sum(ks) - N))) 387 storedinds(C)[Ck] = activerow 388 storedvals(C)[Ck] = Cx 389 Ck += 1 390 end 1|debug> w 1] Ck: 7 2] spaceC: 6 3] storedinds(C): [1, 2, 3, 4, 5, 6] 4] (Ck + min(length(C), _sumnnzs(As...))) - (sum(ks) - N): 1 1|debug> n In _map_zeropres!(f, C, As) at /julia/stdlib/v1.0/SparseArrays/src/higherorderfns.jl:372 383 vals, ks, rows = _fusedupdate_all(rowsentinel, activerow, rows, ks, stopks, As) 384 Cx = f(vals...) 385 if !_iszero(Cx) 386 Ck > spaceC && (spaceC = expandstorage!(C, Ck + min(length(C), _sumnnzs(As...)) - (sum(ks) - N))) >387 storedinds(C)[Ck] = activerow 388 storedvals(C)[Ck] = Cx 389 Ck += 1 390 end 391 activerow = min(rows...) 1|debug> w 1] Ck: 7 2] spaceC: 1 # <-- What?? 3] storedinds(C): [1, 2, 3, 4, 5, 6] 4] (Ck + min(length(C), _sumnnzs(As...))) - (sum(ks) - N): 1
The text was updated successfully, but these errors were encountered:
fix #31758: out of bounds write in sparse broadcast
d2d5dc3
c0c6f96
fix #31758: out of bounds write in sparse broadcast (#31763)
b0187e8
(cherry picked from commit c0c6f96)
031c35c
11b8f59
4f4384a
No branches or pull requests
Reduced from https://discourse.julialang.org/t/signal-11-segmentation-fault-11-with-differentialequations-jl/23264/:
where the last line causes a segfault (
BoundsError
with--check-bounds=yes
). The problem is here:julia/stdlib/SparseArrays/src/higherorderfns.jl
Line 390 in c83e312
1
in this particular case. From Debugger:The text was updated successfully, but these errors were encountered: