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

Cannot safely exit Pluto on Windows + git bash #2136

Closed
tbeason opened this issue May 27, 2022 · 8 comments · Fixed by #2293
Closed

Cannot safely exit Pluto on Windows + git bash #2136

tbeason opened this issue May 27, 2022 · 8 comments · Fixed by #2293
Labels
backend Concerning the julia server and runtime bug Something isn't working help welcome If you are experienced in this topic - let us know! HTTP/WS The connection between backend and frontend wide audience This affects a wide audience of Pluto users and future Pluto users

Comments

@tbeason
Copy link

tbeason commented May 27, 2022

Recently, meaning within the last few weeks, I cannot close Pluto anymore without experiencing a SEGFAULT. I use Windows Terminal + Git Bash for my Julia REPL experience and am on Windows 10. I start Julia, then import Pluto; Pluto.run() and Pluto runs without issue. When I am ready to close out, I return to the REPL and hit Ctrl+C. Nothing happens. If I continue to mash/hit Ctrl+C eventually I get

WARNING: Force throwing a SIGINT
Segmentation fault
Windows.PowerShell.2022-05-27.11-24-11.mp4
@fonsp fonsp changed the title Cannot safely exit Pluto on Windows Cannot safely exit Pluto on Windows + git bash Jun 1, 2022
@fonsp
Copy link
Owner

fonsp commented Jun 2, 2022

What happens when you interrupt this code snippet?

~ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.7.0 (2021-11-30)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> try
           sleep(1000)
       catch e
           typeof(e)
       end
^CInterruptException

julia> 

@tbeason
Copy link
Author

tbeason commented Jun 6, 2022

Same thing. Hmm. I do not recall having these problems when I interrupt other things at REPL.

@AshtonSBradley
Copy link
Contributor

On MacOS, 1.8.0-rc1 Intel, ctrl-C does not interrupt safely anymore. An error that never recovers to terminal:

^Cfatal: error thrown and no exception handler available.
InterruptException()
ijl_task_get_next at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
poptask at ./task.jl:919
wait at ./task.jl:928
task_done_hook at ./task.jl:632
jfptr_task_done_hook_28572.clone_1 at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
ijl_apply_generic at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
jl_finish_task at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
start_task at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
┌ Warning: Reading WebSocket client stream failed for unknown reason:
│   exception =
│    schedule: Task not runnable
│    Stacktrace:
│      [1] error(s::String)
│        @ Base ./error.jl:35
│      [2] schedule(t::Task, arg::Any; error::Bool)
│        @ Base ./task.jl:789
│      [3] schedule
│        @ ./task.jl:787 [inlined]
│      [4] uv_writecb_task(req::Ptr{Nothing}, status::Int32)
│        @ Base ./stream.jl:1161
│      [5] process_events
│        @ ./libuv.jl:104 [inlined]
│      [6] wait()
│        @ Base ./task.jl:930
│      [7] wait(c::Base.GenericCondition{Base.Threads.SpinLock})
│        @ Base ./condition.jl:124
│      [8] wait_readnb(x::Sockets.TCPSocket, nb::Int64)
│        @ Base ./stream.jl:416
│      [9] eof(s::Sockets.TCPSocket)
│        @ Base ./stream.jl:106
│     [10] eof(t::HTTP.ConnectionPool.Transaction{Sockets.TCPSocket})
│        @ HTTP.ConnectionPool ~/.julia/packages/HTTP/aTjcj/src/ConnectionPool.jl:222
│     [11] eof
│        @ ~/.julia/packages/HTTP/aTjcj/src/WebSockets.jl:255 [inlined]
│     [12] (::Pluto.var"#401#413"{Pluto.ServerSession, Base.RefValue{Function}})(clientstream::HTTP.WebSockets.WebSocket{HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}})
│        @ Pluto ~/.julia/packages/Pluto/Bug7E/src/webserver/WebServer.jl:166
│     [13] upgrade(f::Pluto.var"#401#413"{Pluto.ServerSession, Base.RefValue{Function}}, http::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}; binary::Bool)
│        @ HTTP.WebSockets ~/.julia/packages/HTTP/aTjcj/src/WebSockets.jl:160
│     [14] upgrade
│        @ ~/.julia/packages/HTTP/aTjcj/src/WebSockets.jl:140 [inlined]
│     [15] (::Pluto.var"#400#412"{Pluto.ServerSession, HTTP.Handlers.Router{Symbol("##312")}, Base.RefValue{Function}})(http::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}})
│        @ Pluto ~/.julia/packages/Pluto/Bug7E/src/webserver/WebServer.jl:161
│     [16] handle
│        @ ~/.julia/packages/HTTP/aTjcj/src/Handlers.jl:270 [inlined]
│     [17] #4
│        @ ~/.julia/packages/HTTP/aTjcj/src/Handlers.jl:351 [inlined]
│     [18] macro expansion
│        @ ~/.julia/packages/HTTP/aTjcj/src/Servers.jl:415 [inlined]
│     [19] (::HTTP.Servers.var"#13#14"{HTTP.Handlers.var"#4#5"{HTTP.Handlers.StreamHandlerFunction{Pluto.var"#400#412"{Pluto.ServerSession, HTTP.Handlers.Router{Symbol("##312")}, Base.RefValue{Function}}}}, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, HTTP.Servers.Server{Nothing, Sockets.TCPServer}, HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}})()
│        @ HTTP.Servers ./task.jl:482
└ @ Pluto ~/.julia/packages/Pluto/Bug7E/src/webserver/WebServer.jl:198


@MarkNahabedian
Copy link

Workaround for @tbeason:

I also run Pluto from gitbash under MSWindiws 10.

I start Pluto with

julia -e 'using Pluto: Pluto.run()' &

When I want to quit Pluto I use the jobs she'll command and then kill the Pluto job.

Looking at my shell history, it appears that recently I needed to include using Pkg; pkg.add("Pluto"); to the Julia command. I don't recall why.

@tbeason
Copy link
Author

tbeason commented Aug 12, 2022

Just to update here. I've been using Windows Powershell as my default in Windows Terminal and still have this issue. So perhaps it is related to Windows Terminal and not the specific terminal "backend"?

@fonsp
Copy link
Owner

fonsp commented Sep 1, 2022

cc @savq

@fonsp
Copy link
Owner

fonsp commented Sep 5, 2022

I opened a Julia issue about a change in interrupt behaviour on Julia 1.8, which I suspect to be the cause here.

JuliaLang/julia#46635

So far I only have my result on MacOS, perhaps someone using a different OS could try to reproduce the issue, and leave a comment with their versioninfo()?

@fonsp
Copy link
Owner

fonsp commented Sep 5, 2022

@Pangoraw did you say that this issue is related to the HTTP 1.0 release? Or was that something else?

@fonsp fonsp added bug Something isn't working help welcome If you are experienced in this topic - let us know! backend Concerning the julia server and runtime HTTP/WS The connection between backend and frontend wide audience This affects a wide audience of Pluto users and future Pluto users labels Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Concerning the julia server and runtime bug Something isn't working help welcome If you are experienced in this topic - let us know! HTTP/WS The connection between backend and frontend wide audience This affects a wide audience of Pluto users and future Pluto users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants