Julia : strange (Windows) cygwin/mintty hang

Hello,

Since yesterday I encounter a very strange hang-up of Julia interactive repl under Cygwin/mintty : no response to my typing until I hit Ctrl-C. Then it dump with following results (see later) where I see that what I typed (“aaaaa” here) coming out at the cygwin prompt..

What is curious is that if I launch Julia in the same mintty window, but under a cmd sub-shell, it works correctly. If I use Terminal, it also works . It I launch it directly through the (Windows, pure) installed icon, it works.

Continuing on cygwin, if I use xterm, or konsole, I have the same result : julia (repl) launched from bash prompt hangs, but works when launched from a cmd sub-shell.

The only change I had was an upgrade of Win11 yesterday?

What could be the reason ?

Here is the stacktrace

julia> Unhandled Task ERROR: TaskFailedException
Stacktrace:
 [1] wait(t::Task)
   @ Base .\task.jl:370
 [2] fetch
   @ .\task.jl:390 [inlined]
 [3] prompt!(term::REPL.Terminals.TextTerminal, prompt::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
   @ REPL.LineEdit C:\Users\davidj\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\LineEdit.jl:2884
 [4] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
   @ REPL.LineEdit C:\Users\davidj\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\LineEdit.jl:2750
 [5] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
   @ REPL C:\Users\davidj\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1506
 [6] (::REPL.var"#79#85"{REPL.LineEditREPL, REPL.REPLBackendRef})()
   @ REPL C:\Users\davidj\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:497

    nested task error: InterruptException:
    Stacktrace:
     [1] poptask(W::Base.IntrusiveLinkedListSynchronized{Task})
       @ Base .\task.jl:1012
     [2] wait()
       @ Base .\task.jl:1021
     [3] wait(c::Base.GenericCondition{Base.Threads.SpinLock}; first::Bool)
       @ Base .\condition.jl:130
     [4] wait
       @ .\condition.jl:125 [inlined]
     [5] wait_readnb(x::Base.TTY, nb::Int64)
       @ Base .\stream.jl:416
     [6] eof(s::Base.TTY)
       @ Base .\stream.jl:106
     [7] eof(io::REPL.Terminals.TTYTerminal)
       @ Base .\io.jl:472
     [8] (::REPL.LineEdit.var"#282#284"{REPL.Terminals.TTYTerminal, REPL.LineEdit.ModalInterface, REPL.LineEdit.MIState, ReentrantLock, REPL.LineEdit.Prompt})()
       @ REPL.LineEdit C:\Users\davidj\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\LineEdit.jl:2850
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 C:\Users\davidj\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:353
  [8] start_repl_backend(backend::REPL.REPLBackend, consumer::Any; get_module::Function)
    @ REPL C:\Users\davidj\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\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 C:\Users\davidj\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:500
 [10] run_repl(repl::REPL.AbstractREPL, consumer::Any)
    @ REPL C:\Users\davidj\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\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: TaskFailedException
    Stacktrace:
     [1] wait(t::Task)
       @ Base .\task.jl:370
     [2] fetch
       @ .\task.jl:390 [inlined]
     [3] prompt!(term::REPL.Terminals.TextTerminal, prompt::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
       @ REPL.LineEdit C:\Users\davidj\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\LineEdit.jl:2884
     [4] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
       @ REPL.LineEdit C:\Users\davidj\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\LineEdit.jl:2750
     [5] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
       @ REPL C:\Users\davidj\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1506
     [6] (::REPL.var"#79#85"{REPL.LineEditREPL, REPL.REPLBackendRef})()
       @ REPL C:\Users\davidj\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:497

        nested task error: InterruptException:
        Stacktrace:
         [1] poptask(W::Base.IntrusiveLinkedListSynchronized{Task})
           @ Base .\task.jl:1012
         [2] wait()
           @ Base .\task.jl:1021
         [3] wait(c::Base.GenericCondition{Base.Threads.SpinLock}; first::Bool)
           @ Base .\condition.jl:130
         [4] wait
           @ .\condition.jl:125 [inlined]
         [5] wait_readnb(x::Base.TTY, nb::Int64)
           @ Base .\stream.jl:416
         [6] eof(s::Base.TTY)
           @ Base .\stream.jl:106
         [7] eof(io::REPL.Terminals.TTYTerminal)
           @ Base .\io.jl:472
         [8] (::REPL.LineEdit.var"#282#284"{REPL.Terminals.TTYTerminal, REPL.LineEdit.ModalInterface, REPL.LineEdit.MIState, ReentrantLock, REPL.LineEdit.Prompt})()
           @ REPL.LineEdit C:\Users\davidj\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\LineEdit.jl:2850
davidj@vivoaiw ~$ aaaaaaaaaaaa

I would consider testing with julia v1.10.9, just to make sure the bug is not related to julia v1.11.5

Tested, same result. Every Julia version (lets,1.11,1.12,nightly) now do not read what I type at keyboard … except Ctrl-C. And only under bash-cygwin

I can’t confirm.

What did you upgrade to?

I had automatic Windows Update : cumulative update for Windows 11 version 24H2 for x64 systems (KB5055523) (translated from French).

I have just received today another automatic update (KB5007651 / for security platform) that I will accept later in the day - situation cannot change in more bad?

What is completely strange for me is that is only under mintty (or cygwin-sublaunched under mintty kde-konsole or xterm). When I launch Cygwin.bat under Windows Terminal it works. And in non-repl mode Julia works also ok.

Update. Launching Cygwin.bat inside Windows terminal, I get a bash login prompt where Julia repl works. If then I launch a konsole,xterm or mintty inside this Terminal, the Julia repl does catch input inside the new window.

I am totally baffled.

Seems more and more a specific Cygwin issue? But what? Related to X11 application? (as it happens only inside cygwin x11-terminal apps)?

I effectively add a Cygwin update a few days ago, (I see in the logs that the cygwin package did upgrade from 3.5.7-1 to 3.6.1-1, and also xkeyboard-config, cygutils-x11 and others), could it be that ?
I can’t understand interaction between keyboard input and Julia could have been changed - that is, only for Julia.

My mintty window is created by git-bash.exe. I haven’t tried x11.

It was Cygwin. Seems the cygwin DLL v3.6.x (now 3.6.1) changes the (console? keyboard ?) input management

https://cygwin.com/pipermail/cygwin-announce/2025-February/012157.html

https://cygwin.com/pipermail/cygwin-announce/2025-April/012266.html.

I just changed back the DLL to cygwin-3.5.7 and all is working normally as before.

Hope the Cygwin people will address the glitch soon (seems other apps had similar, if not identical, issues).