Skip to content

extraneous type parameter induces segfault #27813

Open

Description

Found while working on #27736:

julia> # removing the `S` here fixes the segfault
       function g(x::T) where {T,S}
           cf = @cfunction identity Ref{T} (Ref{T},)
           GC.@preserve cf begin
               fptr = Base.unsafe_convert(Ptr{Cvoid}, cf)
               ccall(fptr, Ref{T}, (Ref{T},), x)
           end
       end
g (generic function with 1 method)

julia> g(1)
[1]    35506 segmentation fault  julia
julia> versioninfo()
Julia Version 0.7.0-beta.9
Commit d7bf89fc1c (2018-06-25 13:53 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin17.5.0)
  CPU: Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behavior

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions