-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Segfault in jl_typemap_level_assoc_exact (?) #20034
Comments
Simplified further: module Segfault
using StaticArrays
# typealias for typeof(view(rand(SMatrix{S1, S2, T, L}), :, 1:0)):
typealias ViewType{S1, S2, T, L} SubArray{T,2,SMatrix{S1, S2, T, L},Tuple{Colon,UnitRange{Int64}},true} # for 0.5
# typealias ViewType{S1, S2, T, L} SubArray{T,2,SMatrix{S1,S2,T,L},Tuple{Base.Slice{Base.OneTo{Int64}},UnitRange{Int64}},true} # for latest master
immutable MatrixHolder{A<:AbstractMatrix}
a::A
end
typealias SpecificMatrixHolder{T} MatrixHolder{ViewType{3, 6, T, 18}}
type Foo{T} end
function bar{T}(foo::Foo{T})::SpecificMatrixHolder{T} # return type annotation required
data = zeros(SMatrix{3, 6, T})
SpecificMatrixHolder{T}(view(data, :, 1 : 1))
end
end # module
foos = (Segfault.Foo{Float64}(),)
for foo in foos
arrayHolder = Segfault.bar(foo) # call to bar must occur in for loop
println(length(arrayHolder.a))
end |
probably will be fixed by #18457, should retest after that is merged. |
I just tried again with the latest nightly (00b1c77) and I first got a method ambiguity error:
but after adding the following method to Base.convert{SA<:StaticArrays.StaticArray}(::Type{SA}, sa::SA) = sa it worked without segfaulting. I tried running in 0.5 again after adding that method, but unfortunately it doesn't fix the segfault on 0.5. I'm very happy that it's fixed on master though, so I'll close the issue. |
JuliaLang/julia#20034, will be fixed in 0.6.
JuliaLang/julia#20034, will be fixed in 0.6.
The following code reliably produces a segfault in
jl_typemap_level_assoc_exact
:on (at least) the following platforms:
On OSX, the output of
julia segfault.jl
(withsegfault.jl
containing the code above) isSegmentation fault: 11
. On Linux, it is:Running Julia in
lldb
on OSX also points tojl_typemap_level_assoc_exact
:Perhaps related to #17288?
The text was updated successfully, but these errors were encountered: