-
Notifications
You must be signed in to change notification settings - Fork 152
Closed
Description
Hello. When I tried to execute example notebook of RegionTrees.jl package I found a segfault on my system (Ubuntu 18.04). Purifying the crashing code I came up with this one:
SEGFAULT = true
using StaticArrays
struct TwosArray{N, T, L} <: StaticArray{NTuple{N, 2}, T, N}
data::NTuple{L, T}
end
Base.getindex(b::TwosArray, i::Int) = b.data[i]
struct SignedDistanceRefinery{F <: Function} # <: AbstractRefinery
signed_distance_func::F
end
function refine_data(refinery::SignedDistanceRefinery, v)
refinery.signed_distance_func.(v)
end
signed_distance(x) = sqrt(sum(x.^2))
refinery = SignedDistanceRefinery(signed_distance)
vp = TwosArray{1,SArray{Tuple{2},Float64,1,2},2}((SVector(1.,2.),SVector(3.,1.)))
!SEGFAULT || refinery.signed_distance_func.(vp)
refine_data(refinery,vp)Interestingly to cause a segfault both last two lines need to be present which also commute with themselves.
Metadata
Metadata
Assignees
Labels
No labels