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

displaysize(tty) after close(tty) segfaults #34620

Closed
tkf opened this issue Feb 1, 2020 · 1 comment · Fixed by #34623
Closed

displaysize(tty) after close(tty) segfaults #34620

tkf opened this issue Feb 1, 2020 · 1 comment · Fixed by #34623
Labels
bug Indicates an unexpected problem or unintended behavior io Involving the I/O subsystem: libuv, read, write, etc.

Comments

@tkf
Copy link
Member

tkf commented Feb 1, 2020

It'd be nice if displaysize(tty) after close(tty) can throw an exception rather than segfault. MWE:

julia> tty = Base.TTY(fd(Base.Filesystem.open("/proc/self/fd/1", Base.Filesystem.JL_O_WRONLY)))
Base.TTY(RawFD(0x00000016) open, 0 bytes waiting)

julia> displaysize(tty)
(43, 114)

julia> close(tty)

julia> displaysize(tty)

signal (11): Segmentation fault
in expression starting at REPL[4]:1
uv_tty_get_winsize at /workspace/srcdir/libuv/src/unix/tty.c:274
displaysize at ./stream.jl:478
jfptr_displaysize_2966 at /home/takafumi/repos/watch/julia/usr/lib/julia/sys.so (unknown line)
jl_apply at /home/takafumi/repos/watch/julia/src/julia.h:1694 [inlined]
do_call at /home/takafumi/repos/watch/julia/src/interpreter.c:369
eval_value at /home/takafumi/repos/watch/julia/src/interpreter.c:458
eval_stmt_value at /home/takafumi/repos/watch/julia/src/interpreter.c:409 [inlined]
eval_body at /home/takafumi/repos/watch/julia/src/interpreter.c:799
jl_interpret_toplevel_thunk at /home/takafumi/repos/watch/julia/src/interpreter.c:911
jl_toplevel_eval_flex at /home/takafumi/repos/watch/julia/src/toplevel.c:814
jl_toplevel_eval_flex at /home/takafumi/repos/watch/julia/src/toplevel.c:764
jl_toplevel_eval_in at /home/takafumi/repos/watch/julia/src/toplevel.c:843
eval at ./boot.jl:331
eval_user_input at /home/takafumi/repos/watch/julia/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:107
run_backend at /home/takafumi/.julia/packages/Revise/SefCg/src/Revise.jl:1042
#85 at ./task.jl:358
jl_apply at /home/takafumi/repos/watch/julia/src/julia.h:1694 [inlined]
start_task at /home/takafumi/repos/watch/julia/src/task.c:687
unknown function (ip: (nil))
Allocations: 14143307 (Pool: 14139964; Big: 3343); GC: 14
@vtjnash
Copy link
Member

vtjnash commented Feb 1, 2020

Duplicate of #26687

@vtjnash vtjnash marked this as a duplicate of #26687 Feb 1, 2020
@JeffBezanson JeffBezanson added bug Indicates an unexpected problem or unintended behavior io Involving the I/O subsystem: libuv, read, write, etc. labels Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior io Involving the I/O subsystem: libuv, read, write, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants