Skip to content

Regression 1.11: Julia fails to start if history file is invalid (or unparseable) #59406

@DilumAluthge

Description

@DilumAluthge

In Julia 1.10.10, if the history file is invalid (or unparseable), then Julia will print a warning, but will still be able to start up, and you can still use the Julia REPL normally (except of course that the history file is disabled).

In Julia 1.11.6, Julia crashes/fails to start in this situation. Obviously, the user can workaround the situation by manually deleting the broken history file, but IMO this is still a regression. I think (if possible) that we should preserve the behavior from 1.10.

h/t @andreasnoack for discovering this.

MWE

dd if=/dev/urandom bs=3 count=1 > ./foo.jl

export JULIA_HISTORY="$(pwd)/foo.jl"

julia

Output

Julia 1.10.10 (click to expand):
dilum@Mac:~/working/foobar$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.10 (2025-06-27)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

ERROR: Invalid history file (/Users/dilum/working/foobar/foo.jl) format:
If you have a history file left over from an older version of Julia,
try renaming or deleting it.
Invalid character: 'V' at line 1
Stacktrace:
  [1] error(::String, ::String, ::String, ::Int64)
    @ Base ./error.jl:44
  [2] hist_from_file(hp::REPL.REPLHistoryProvider, path::String)
    @ REPL ~/.asdf/installs/julia/1.10.10/share/julia/stdlib/v1.10/REPL/src/REPL.jl:618
  [3] setup_interface(repl::REPL.LineEditREPL, hascolor::Bool, extra_repl_keymap::Any)
    @ REPL ~/.asdf/installs/julia/1.10.10/share/julia/stdlib/v1.10/REPL/src/REPL.jl:1065
  [4] setup_interface
    @ ~/.asdf/installs/julia/1.10.10/share/julia/stdlib/v1.10/REPL/src/REPL.jl:971 [inlined]
  [5] (::Pkg.var"#3#4")(repl::REPL.LineEditREPL)
    @ Pkg ~/.asdf/installs/julia/1.10.10/share/julia/stdlib/v1.10/Pkg/src/Pkg.jl:732
  [6] __atreplinit(repl::REPL.LineEditREPL)
    @ Base ./client.jl:388
  [7] #invokelatest#2
    @ ./essentials.jl:892 [inlined]
  [8] invokelatest
    @ ./essentials.jl:889 [inlined]
  [9] _atreplinit
    @ ./client.jl:395 [inlined]
 [10] (::Base.var"#1016#1018"{Bool, Bool, Bool})(REPL::Module)
    @ Base ./client.jl:436
 [11] #invokelatest#2
    @ ./essentials.jl:892 [inlined]
 [12] invokelatest
    @ ./essentials.jl:889 [inlined]
 [13] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
    @ Base ./client.jl:421
 [14] exec_options(opts::Base.JLOptions)
    @ Base ./client.jl:338
 [15] _start()
    @ Base ./client.jl:557

[ Info: Disabling history file for this session
julia>
Julia 1.11.6 (click to expand):
dilum@Mac:~/working/foobar$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.11.6 (2025-07-09)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

Unhandled Task ERROR: UndefRefError: access to undefined reference
Stacktrace:
 [1] getproperty
   @ ./Base.jl:49 [inlined]
 [2] backend
   @ ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:997 [inlined]
 [3] (::REPL.var"#70#71"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
   @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:405
 [4] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
   @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:678
 [5] print_response
   @ ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:403 [inlined]
 [6] setup_interface(repl::REPL.LineEditREPL, hascolor::Bool, extra_repl_keymap::Any)
   @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1224
 [7] setup_interface
   @ ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1092 [inlined]
 [8] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
   @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1502
 [9] (::REPL.var"#79#85"{REPL.LineEditREPL, REPL.REPLBackendRef})()
   @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:497

caused by: Invalid history file (/Users/dilum/working/foobar/foo.jl) format:
If you have a history file left over from an older version of Julia,
try renaming or deleting it.
Invalid character: 'V' at line 1
Stacktrace:
 [1] error(::String, ::String, ::String, ::Int64)
   @ Base ./error.jl:44
 [2] hist_from_file(hp::REPL.REPLHistoryProvider, path::String)
   @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:727
 [3] setup_interface(repl::REPL.LineEditREPL, hascolor::Bool, extra_repl_keymap::Any)
   @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1221
 [4] setup_interface
   @ ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1092 [inlined]
 [5] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
   @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1502
 [6] (::REPL.var"#79#85"{REPL.LineEditREPL, REPL.REPLBackendRef})()
   @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:497
ERROR: TaskFailedException
Stacktrace:
  [1] try_yieldto(undo::typeof(Base.ensure_rescheduled))
    @ Base ./task.jl:958
  [2] wait()
    @ Base ./task.jl:1022
  [3] wait(c::Base.GenericCondition{ReentrantLock}; first::Bool)
    @ Base ./condition.jl:130
  [4] wait
    @ ./condition.jl:125 [inlined]
  [5] take_buffered(c::Channel{Any})
    @ Base ./channels.jl:493
  [6] take!
    @ ./channels.jl:487 [inlined]
  [7] repl_backend_loop(backend::REPL.REPLBackend, get_module::Function)
    @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:353
  [8] start_repl_backend(backend::REPL.REPLBackend, consumer::Any; get_module::Function)
    @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:343
  [9] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool, backend::Any)
    @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:500
 [10] run_repl(repl::REPL.AbstractREPL, consumer::Any)
    @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:486
 [11] (::Base.var"#1150#1152"{Bool, Symbol, Bool})(REPL::Module)
    @ Base ./client.jl:446
 [12] #invokelatest#2
    @ ./essentials.jl:1055 [inlined]
 [13] invokelatest
    @ ./essentials.jl:1052 [inlined]
 [14] run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, history_file::Bool, color_set::Bool)
    @ Base ./client.jl:430
 [15] repl_main
    @ ./client.jl:567 [inlined]
 [16] _start()
    @ Base ./client.jl:541

    nested task error: UndefRefError: access to undefined reference
    Stacktrace:
     [1] getproperty
       @ ./Base.jl:49 [inlined]
     [2] backend
       @ ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:997 [inlined]
     [3] (::REPL.var"#70#71"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
       @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:405
     [4] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
       @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:678
     [5] print_response
       @ ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:403 [inlined]
     [6] setup_interface(repl::REPL.LineEditREPL, hascolor::Bool, extra_repl_keymap::Any)
       @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1224
     [7] setup_interface
       @ ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1092 [inlined]
     [8] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
       @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1502
     [9] (::REPL.var"#79#85"{REPL.LineEditREPL, REPL.REPLBackendRef})()
       @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:497

    caused by: Invalid history file (/Users/dilum/working/foobar/foo.jl) format:
    If you have a history file left over from an older version of Julia,
    try renaming or deleting it.
    Invalid character: 'V' at line 1
    Stacktrace:
     [1] error(::String, ::String, ::String, ::Int64)
       @ Base ./error.jl:44
     [2] hist_from_file(hp::REPL.REPLHistoryProvider, path::String)
       @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:727
     [3] setup_interface(repl::REPL.LineEditREPL, hascolor::Bool, extra_repl_keymap::Any)
       @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1221
     [4] setup_interface
       @ ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1092 [inlined]
     [5] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
       @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1502
     [6] (::REPL.var"#79#85"{REPL.LineEditREPL, REPL.REPLBackendRef})()
       @ REPL ~/.asdf/installs/julia/1.11.6/share/julia/stdlib/v1.11/REPL/src/REPL.jl:497

Metadata

Metadata

Assignees

No one assigned

    Labels

    bisect completedbugIndicates an unexpected problem or unintended behaviorregression 1.11Regression in the 1.11 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions