Skip to content
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

"showing an error caused an error" when including files #517

Closed
fredcallaway opened this issue Jul 13, 2021 · 3 comments
Closed

"showing an error caused an error" when including files #517

fredcallaway opened this issue Jul 13, 2021 · 3 comments

Comments

@fredcallaway
Copy link

fredcallaway commented Jul 13, 2021

I find that any error that results from an include call itself causes an error.

Simplest example is to include a file that doesn't exist. We get a similar thing when including a file that throws an error.

julia> include("missing_file.jl")                                                                             
ERROR: SystemError: opening file "/Users/fred/missing_file.jl": No such file or directory
SYSTEM (REPL): showing an error caused an error
ERROR: BoundsError: attempt to access 16-element BitVector at index [0:5]
Stacktrace
Stacktrace:
  [1] throw_boundserror(A::BitVector, I::Tuple{UnitRange{Int64}})
    @ Base ~/lib/precompile-julia/sysimage.so:-1
  [2] _simplify_include_frames(trace::Vector{Any})
    @ Base ~/lib/precompile-julia/sysimage.so:-1
  [3] process_backtrace(t::Vector{Base.StackTraces.StackFrame}, limit::Int64; skipC::Bool)
    @ Base ~/lib/precompile-julia/sysimage.so:-1
  [4] show_backtrace(io::IOContext{Base.TTY}, t::Vector{Base.StackTraces.StackFrame})
    @ Base ~/lib/precompile-julia/sysimage.so:-1
  [5] showerror(io::IOContext{Base.TTY}, ex::SystemError, bt::Vector{Base.StackTraces.StackFrame}; backtrace::Bool)
    @ Base ./errorshow.jl:90
  [6] show_exception_stack(io::IOContext{Base.TTY}, stack::Vector{Any})
    @ Base ~/lib/precompile-julia/sysimage.so:-1
  [7] display_error(io::IOContext{Base.TTY}, stack::Vector{Any})
    @ Base ~/lib/precompile-julia/sysimage.so:-1
  [8] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
    @ REPL ~/lib/precompile-julia/sysimage.so:-1
  [9] (::REPL.var"#40#41"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL ~/lib/precompile-julia/sysimage.so:-1
 [10] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL ~/lib/precompile-julia/sysimage.so:-1
 [11] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL ~/lib/precompile-julia/sysimage.so:-1
 [12] (::REPL.var"#do_respond#61"{Bool, Bool, REPL.var"#72#82"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL ~/lib/precompile-julia/sysimage.so:-1
 [13] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit ~/lib/precompile-julia/sysimage.so:-1
 [14] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL ~/lib/precompile-julia/sysimage.so:-1
 [15] (::REPL.var"#44#49"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ~/lib/precompile-julia/sysimage.so:-1

I don't know exactly when this started happening, but I'd guess it's related to the new stack trace format (introduced in 1.6 I think?)

I'm using v1.2.6 with a fresh precompiled image (including only the Distributions.jl package)

@KristofferC
Copy link
Sponsor Member

Looks like a Julia bug. I don't think it has to do with the new stack trace format but rather that there is some bug in this function:

https://github.com/JuliaLang/julia/blob/d7329038feb207997b9a6d969c5c8f11d37680d5/base/errorshow.jl#L775-L807

@fredcallaway
Copy link
Author

Good catch! I'll make an issue in the main language repo.

@KristofferC
Copy link
Sponsor Member

Think this is fixed upstream now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants