JuliaWeb / RemoteREPL.jl

Connect a REPL to a remote Julia process
MIT License
122 stars 11 forks source link

error in running finalizer: Base.IOError(msg="write: broken pipe (EPIPE)", code=-32) #57

Open filchristou opened 1 year ago

filchristou commented 1 year ago

After I close a the server socket and exit the client REPL I get the following error:

error in running finalizer: Base.IOError(msg="write: broken pipe (EPIPE)", code=-32)
uv_write at ./stream.jl:1066
unsafe_write at ./stream.jl:1120
write at ./strings/io.jl:244 [inlined]
writeheader at /cache/build/default-amdci4-6/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/Serialization/src/Serialization.jl:705
serialize at /cache/build/default-amdci4-6/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/Serialization/src/Serialization.jl:778
unknown function (ip: 0x7f60479115f6)
_jl_invoke at /cache/build/default-amdci4-6/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci4-6/julialang/julia-release-1-dot-9/src/gf.c:2940
close at /u/home/wima/fchrstou/.julia/packages/RemoteREPL/BFqrB/src/client.jl:165
unknown function (ip: 0x7f6047904102)
_jl_invoke at /cache/build/default-amdci4-6/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci4-6/julialang/julia-release-1-dot-9/src/gf.c:2940
run_finalizer at /cache/build/default-amdci4-6/julialang/julia-release-1-dot-9/src/gc.c:417
jl_gc_run_finalizers_in_list at /cache/build/default-amdci4-6/julialang/julia-release-1-dot-9/src/gc.c:507
run_finalizers at /cache/build/default-amdci4-6/julialang/julia-release-1-dot-9/src/gc.c:553
ijl_atexit_hook at /cache/build/default-amdci4-6/julialang/julia-release-1-dot-9/src/init.c:299
jl_repl_entrypoint at /cache/build/default-amdci4-6/julialang/julia-release-1-dot-9/src/jlapi.c:718
main at julia (unknown line)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x401098)

Reproduce with

start a RemoteREPL server in one julia kernel:

julia> using RemoteREPL, Sockets

julia> server = Sockets.listen(Sockets.localhost, 9093)
Sockets.TCPServer(RawFD(21) active)

julia> @async serve_repl(server)

start a RemoteREPL client in another julia kernel:

julia> using RemoteREPL, Sockets

julia> connect_repl(Sockets.localhost, 9093)
REPL mode remote_repl initialized. Press > to enter and backspace to exit.
"Prompt(\"julia@localhost:9093> \",...)"

now, close the connection in the server:

julia> close(server)

┌ Info: REPL client exited
└   peer = (ip"127.0.0.1", 0xc0c8)

and, now exit the client kernel (e.g. Ctrl-D ) In my system this prints the error above. Can you reproduce ?

System

julia> versioninfo()
Julia Version 1.9.1
Commit 147bdf428cd (2023-06-07 08:27 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 12 × 12th Gen Intel(R) Core(TM) i5-1235U
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, alderlake)
  Threads: 1 on 12 virtual cores

debian 11 RemoteREPL v0.2.17