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

Weird REPL crash #29988

Closed
chethega opened this issue Nov 9, 2018 · 1 comment
Closed

Weird REPL crash #29988

chethega opened this issue Nov 9, 2018 · 1 comment

Comments

@chethega
Copy link
Contributor

chethega commented Nov 9, 2018

I get a weird REPL crash when pasting the following into a fresh session:

julia> struct Test{A,B} end
julia> Base.show(io::IO, ::Type{Test{A,B}}) where {A,B} = print(io, "fooTest{", A, ",", B, "}")
julia> Test{A,Int} where A

which crashes julia, with output:

Error showing value of type UnionAll:
ERROR: UndefVarError: A not defined
Stacktrace:
 [1] show(::IOContext{REPL.Terminals.TTYTerminal}, ::Type{SYSTEM: show(lasterr) caused an error
UndefVarError(:A)

Stacktrace:
 [1] show(::IOContext{REPL.Terminals.TTYTerminal}, ::Type{ERROR: UndefVarError: A not defined
Stacktrace:
 [1] show(::IOContext{REPL.Terminals.TTYTerminal}, ::Type{fatal: error thrown and no exception handler available.
UndefVarError(var=:A)
unknown function (ip: 0x7fc55f0bf438)
unknown function (ip: 0x7fc55f0903e3)
jl_throw at /usr/bin/../lib/libjulia.so.1 (unknown line)
jl_undefined_var_error at /usr/bin/../lib/libjulia.so.1 (unknown line)
show at ./REPL[2]:1
jl_fptr_trampoline at /usr/bin/../lib/libjulia.so.1 (unknown line)
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
show_datatype at ./show.jl:526
show at ./show.jl:436
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
print at ./strings/io.jl:31
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
print at ./strings/io.jl:42
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
show_tuple_as_call at ./show.jl:1490
jl_fptr_trampoline at /usr/bin/../lib/libjulia.so.1 (unknown line)
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
show_spec_linfo at ./stacktraces.jl:261
#show#9 at ./stacktraces.jl:272
unknown function (ip: 0x7fc541b1b753)
jl_fptr_trampoline at /usr/bin/../lib/libjulia.so.1 (unknown line)
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
#show at ./none:0 [inlined]
#show_trace_entry#630 at ./errorshow.jl:471
unknown function (ip: 0x7fc541b1b08c)
jl_fptr_trampoline at /usr/bin/../lib/libjulia.so.1 (unknown line)
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
#show_trace_entry at ./none:0
unknown function (ip: 0x7fc541b1adc8)
jl_fptr_trampoline at /usr/bin/../lib/libjulia.so.1 (unknown line)
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
show_backtrace at ./errorshow.jl:574
#showerror#612 at ./errorshow.jl:79
unknown function (ip: 0x7fc541b182d7)
jl_fptr_trampoline at /usr/bin/../lib/libjulia.so.1 (unknown line)
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
showerror at ./errorshow.jl:74 [inlined]
display_error at ./client.jl:99
jl_fptr_trampoline at /usr/bin/../lib/libjulia.so.1 (unknown line)
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
display_error at ./client.jl:102
jl_fptr_trampoline at /usr/bin/../lib/libjulia.so.1 (unknown line)
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
jl_f__apply at /usr/bin/../lib/libjulia.so.1 (unknown line)
jl_f__apply_latest at /usr/bin/../lib/libjulia.so.1 (unknown line)
unknown function (ip: 0x7fc556752477)
jl_apply_generic at /usr/bin/../lib/libjulia.so.1 (unknown line)
true_main at /home/bruhns/math/persistence/julia/julia7/julia/ui/repl.c:89
 at julia (unknown line)
__libc_start_main at /usr/bin/../lib/libc.so.6 (unknown line)
 at julia (unknown line)

The above trace is on 1.0.1. The reproduction is relatively finnicky; the crash goes away when pasting with a newline in the last command, and appears when the last command is pasted without newline, and I hit enter manually. Regardless of the crash, I don't think dispatching to the new method is correct? Cf also discourse..

I tested on:

julia> versioninfo()
Julia Version 1.0.1
Commit 0d713926f8 (2018-09-29 19:05 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i5-5###U CPU @ 2.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, broadwell)

julia> versioninfo()
Julia Version 1.1.0-DEV.647
Commit c62ff7e8a9 (2018-11-09 15:47 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i5-5###U CPU @ 2.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, broadwell)
@JeffBezanson
Copy link
Sponsor Member

Duplicate of #29428, #22363, #28983.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants