JuliaImages / ImageView.jl

Interactive display of images and movies
MIT License
135 stars 34 forks source link

StackOverflowError when using imshow #273

Closed mgalenb closed 1 year ago

mgalenb commented 2 years ago

Loading an image takes a long time but eventually gives a StackOverflowError. Related to dictionary?

using ImageView, TestImages
img=testimage("cam")
julia> imshow(img)
Dict{String, Any} with 4 entries:Error showing value of type Dict{String, Any}:
ERROR: StackOverflowError:
Stacktrace:
     [1] make_typealias(x::Type)
       @ Base ./show.jl:562
     [2] show_typealias(io::IOContext{IOBuffer}, x::Type)
       @ Base ./show.jl:723
     [3] _show_type(io::IOContext{IOBuffer}, x::Type)
       @ Base ./show.jl:886
     [4] show(io::IOContext{IOBuffer}, x::Type)
       @ Base ./show.jl:881
     [5] show_typeparams(io::IOContext{IOBuffer}, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar})
       @ Base ./show.jl:640
     [6] show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar})
       @ Base ./show.jl:1011
     [7] show_datatype
       @ ./show.jl:989 [inlined]
     [8] _show_type(io::IOContext{IOBuffer}, x::Type)
       @ Base ./show.jl:889
--- the last 5 lines are repeated 1 more time ---
    [14] show(io::IOContext{IOBuffer}, x::Type)
       @ Base ./show.jl:881
    [15] _show_default(io::IOContext{IOBuffer}, x::Any)
       @ Base ./show.jl:400
    [16] show_default
       @ ./show.jl:396 [inlined]
    [17] show_function(io::IOContext{IOBuffer}, f::Function, compact::Bool)
       @ Base ./show.jl:464
    [18] show(io::IOContext{IOBuffer}, f::Function)
       @ Base ./show.jl:468
    [19] _show_default(io::IOBuffer, x::Any)
       @ Base ./show.jl:413
    [20] show_default
       @ ./show.jl:396 [inlined]
    [21] show_function(io::IOBuffer, f::Function, compact::Bool)
       @ Base ./show.jl:452
    [22] print(io::IOBuffer, f::Function)
       @ Base ./show.jl:469
    [23] print_to_string(xs::Function)
       @ Base ./strings/io.jl:144
    [24] string
       @ ./strings/io.jl:185 [inlined]
    [25] Symbol
       @ ./strings/basic.jl:229 [inlined]
    [26] isdelimited(io::IOContext{IOBuffer}, x::Function)
       @ Base ./show.jl:1072
    [27] show(io::IOContext{IOBuffer}, p::Pair{String, Any})
       @ Base ./show.jl:1090
    [28] show(io::IOContext{IOBuffer}, t::Dict{String, Any})
       @ Base ./dict.jl:38
    [29] _show_default(io::IOContext{IOBuffer}, x::Any)
       @ Base ./show.jl:413
--- the last 14 lines are repeated 1597 more times ---
 [22388] show_default
       @ ./show.jl:396 [inlined]
 [22389] show_function(io::IOContext{IOBuffer}, f::Function, compact::Bool)
       @ Base ./show.jl:464
 [22390] show(io::IOContext{IOBuffer}, f::Function)
       @ Base ./show.jl:468
 [22391] _show_default(io::IOBuffer, x::Any)
       @ Base ./show.jl:413
 [22392] show_default
       @ ./show.jl:396 [inlined]
 [22393] show_function(io::IOBuffer, f::Function, compact::Bool)
       @ Base ./show.jl:452
 [22394] print(io::IOBuffer, f::Function)
       @ Base ./show.jl:469
 [22395] print_to_string(xs::Function)
       @ Base ./strings/io.jl:144
 [22396] string
       @ ./strings/io.jl:185 [inlined]
 [22397] Symbol
       @ ./strings/basic.jl:229 [inlined]
 [22398] isdelimited(io::IOContext{IOBuffer}, x::Function)
       @ Base ./show.jl:1072
 [22399] show(io::IOContext{IOBuffer}, p::Pair{String, Any})
       @ Base ./show.jl:1090
 [22400] show(io::IOContext{IOBuffer}, t::Dict{String, Any})
       @ Base ./dict.jl:38
 [22401] sprint(f::Function, args::Dict{String, Any}; context::IOContext{Base.TTY}, sizehint::Int64)
       @ Base ./strings/io.jl:112
 [22402] show(io::IOContext{Base.TTY}, #unused#::MIME{Symbol("text/plain")}, t::Dict{String, Any})
       @ Base ./show.jl:112
 [22403] display(d::REPL.REPLDisplay{REPL.LineEditREPL}, mime::MIME{Symbol("text/plain")}, x::Dict{String, Any})
       @ OhMyREPL ~/.julia/packages/OhMyREPL/oDZvT/src/output_prompt_overwrite.jl:8
 [22404] display(d::REPL.REPLDisplay, x::Any)
       @ REPL /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/REPL.jl:271
 [22405] display(x::Any)
       @ Base.Multimedia ./multimedia.jl:328
 [22406] #invokelatest#2
       @ ./essentials.jl:716 [inlined]
 [22407] invokelatest
       @ ./essentials.jl:714 [inlined]
 [22408] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
       @ REPL /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/REPL.jl:293
 [22409] (::REPL.var"#45#46"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
       @ REPL /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/REPL.jl:277
 [22410] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
       @ REPL /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/REPL.jl:510
 [22411] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
       @ REPL /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/REPL.jl:275
 [22412] (::REPL.var"#do_respond#66"{Bool, Bool, REPL.var"#77#87"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
       @ REPL /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/REPL.jl:846
 [22413] #invokelatest#2
       @ ./essentials.jl:716 [inlined]
 [22414] invokelatest
       @ ./essentials.jl:714 [inlined]
 [22415] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
       @ REPL.LineEdit /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/LineEdit.jl:2493
 [22416] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
       @ REPL /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/REPL/src/REPL.jl:1232
mgalenb commented 2 years ago

on macOS 11.6.8

mgalenb commented 1 year ago

tested on Julia 1.8.0 and this works

using TestImages, ImageShow
img=testimage("mandrill")
imshow(img)

ill close the issue