Skip to content

Segfault when defining show for types #22363

@quinnj

Description

@quinnj

Here's the minimum repro

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-DEV.511 (2017-06-08 21:22 UTC)
 _/ |\__'_|_|_|\__'_|  |  (HEAD detached at origin/jb/namedtuples)/e2c2724982* (fork: 6 commits, 5 days)
|__/                   |  x86_64-apple-darwin16.6.0

julia> struct Null end

julia> Base.show(io::IO, ::Type{Union{T, Null}}) where {T} = print(io, "?$T")

julia> struct WeakRefString{T} <: AbstractString
           ptr::Ptr{T}
           len::Int # of code units
           ind::Int # used to keep track of a string data index
       end

julia> Base.show(io::IO, ::Type{WeakRefString{T}}) where {T} = print(io, "WeakRefString{$T}")

julia> temp = []
Segmentation fault: 11
jq-mbp:julia jacobquinn$

Note the last thing that happens is it's trying to display 0-element Array{Any,1}.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions