Skip to content

Infiltrator REPL hangs on v1.12 #138

@aviatesk

Description

@aviatesk

It seems like the show mechanism, which is automatically hooked into the Infiltrator REPL, isn't working correctly. The Infiltrator REPL starts up fine, but when I send code to it, the REPL freezes.
I tested it without loading a startup file, using these steps:

   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _  |  |
  | | |_| | | | (_| |  |  Version 1.12.0-beta1 (2025-04-02)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org release
|__/                   |

julia> using Infiltrator

julia> using Example

(Example) julia> """
                     domath(x::Number)

                 Return `x + 5`.
                 """
                 function domath(x::Number)
                     # Main.@infiltrate
                     x + 5
                 end
domath

(Example) julia> """
                     domath(x::Number)

                 Return `x + 5`.
                 """
                 function domath(x::Number)
                     Main.@infiltrate
                     x + 5
                 end
[ Warning: @infiltrate is defined in Infiltrator and is not public in Main
domath

julia> domath(42)
Infiltrating domath(x::Int64)
  at REPL[8]:7


infil> x # hangs
^CERROR: InterruptException:
Stacktrace:
  [1] poptask(W::Base.IntrusiveLinkedListSynchronized{Task})
    @ Base ./task.jl:1187
  [2] wait()
    @ Base ./task.jl:1199
  [3] wait(c::Base.GenericCondition{ReentrantLock}; first::Bool)
    @ Base ./condition.jl:141
  [4] wait
    @ ./condition.jl:136 [inlined]
  [5] take_buffered(c::Channel{Any})
    @ Base ./channels.jl:532
  [6] take!
    @ ./channels.jl:526 [inlined]
  [7] eval_with_backend
    @ /Applications/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/REPL/src/REPL.jl:1157 [inlined]
  [8] print_response(errio::IO, response::Any, backend::Union{Nothing, REPL.REPLBackendRef}, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
    @ REPL /Applications/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/REPL/src/REPL.jl:587
  [9] (::REPL.var"#print_response##0#print_response##1"{REPL.LineEditREPL, Tuple{Int64, Bool}, Bool, Bool})(io::Any)
    @ REPL /Applications/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/REPL/src/REPL.jl:556
 [10] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL /Applications/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/REPL/src/REPL.jl:829
 [11] print_response
    @ /Applications/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/REPL/src/REPL.jl:554 [inlined]
 [12] (::Infiltrator.var"#26#27"{Bool, String, Int64, Dict{}, Vector{}, REPL.LineEditREPL, Nothing, Nothing, Module, Base.TTY})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
    @ Infiltrator ~/julia/packages/Infiltrator/src/Infiltrator.jl:742
 [13] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit /Applications/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:2852
 [14] run_interface
    @ /Applications/Julia-1.12.app/Contents/Resources/julia/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:2846 [inlined]
 [15] debugprompt(mod::Module, locals::Dict{…}, trace::Vector{…}, terminal::REPL.Terminals.TTYTerminal, repl::REPL.LineEditREPL, ex::Nothing, bt::Nothing; nostack::Bool, file::String, fileline::Int64)
    @ Infiltrator ~/julia/packages/Infiltrator/src/Infiltrator.jl:763
 [16] start_prompt(mod::Module, locals::Dict{Symbol, Any}, file::String, fileline::Int64, ex::Nothing, bt::Nothing; terminal::Nothing, repl::Nothing, nostack::Bool)
    @ Infiltrator ~/julia/packages/Infiltrator/src/Infiltrator.jl:421
 [17] start_prompt(mod::Module, locals::Dict{Symbol, Any}, file::String, fileline::Int64, ex::Nothing, bt::Nothing)
    @ Infiltrator ~/julia/packages/Infiltrator/src/Infiltrator.jl:321
 [18] start_prompt
    @ ~/julia/packages/Infiltrator/src/Infiltrator.jl:321 [inlined]
 [19] macro expansion
    @ ~/julia/packages/Infiltrator/src/Infiltrator.jl:76 [inlined]
 [20] domath(x::Int64)
    @ Example ./REPL[8]:7
Some type information was truncated. Use `show(err)` to see complete types.

I confirmed that display(x) works fine instead of infil> x.

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