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

REPL: history search crash with TAB #8199

Closed
cmcbride opened this issue Sep 1, 2014 · 6 comments
Closed

REPL: history search crash with TAB #8199

cmcbride opened this issue Sep 1, 2014 · 6 comments
Labels
bug Indicates an unexpected problem or unintended behavior REPL Julia's REPL (Read Eval Print Loop)

Comments

@cmcbride
Copy link

cmcbride commented Sep 1, 2014

Found accidentally, but it looks like history search and tab completion don't play well together. I'm assuming this is a bug...

When using REPL history search (CTRL-R), hitting TAB will throw an error that ends the REPL session (see below). It seems consistent and TAB does not have to be the first character.

julia> versioninfo()
Julia Version 0.3.1-pre+23
Commit 77c15f9* (2014-08-31 17:39 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.3.0)
  CPU: Intel(R) Core(TM) i5-4288U CPU @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

(reverse-i-search)`': ERROR: `input_string` has no method matching input_string(::SearchState)
 in complete_line at REPL.jl:294
 in complete_line at LineEdit.jl:988
 in complete_line at LineEdit.jl:139
 in anonymous at LineEdit.jl:1100
 in prompt! at ./LineEdit.jl:1397
 in run_interface at ./LineEdit.jl:1372
 in run_interface at /Users/cameron/code/julia/julia/usr/lib/julia/sys.dylib
 in run_frontend at ./REPL.jl:819
 in run_repl at ./REPL.jl:170
 in _start at ./client.jl:399
 in _start at /Users/cameron/code/julia/julia/usr/lib/julia/sys.dylib
@flpf
Copy link

flpf commented Sep 3, 2014

Hi.

I think I found a similar problem.
In a Julia-REPL without loaded packages tab-completion of functions results in

julia> writedlm( [...Hitting Tab gives..]

writedlm(io::IO,a::Union(AbstractArray{T,1},AbstractArray{T,2}),dlm) at datafmt.jl:502
writedlm{T}(io::IO,a::AbstractArray{T,0},dlm) at datafmt.jl:518
writedlm(io::IO,a::AbstractArray{T,N},dlm) at datafmt.jl:521
writedlm(io::IO,itr,dlm) at datafmt.jl:532
writedlm(fname::String,a,dlm) at datafmt.jl:549
writedlm(io,a) at datafmt.jl:554

After loading a package (I've tried PyPlot, Gadfly, Winston) julia crashes on tab-completion

julia> using Winston

julia> writedlm( [...Hitting Tab gives...] ERROR: type UnionType has no field body
 in show at show.jl:80 (repeats 2 times)
 in print_to_string_3B_504 at /usr/bin/../lib/julia/sys.so
 in argtype_decl at methodshow.jl:18
 in arg_decl_parts at methodshow.jl:30
 in show at methodshow.jl:36
 in print_to_string at string.jl:24
 in string at string.jl:31
 in complete_methods_3B_1834 at /usr/bin/../lib/julia/sys.so
 in completions_3B_1827 at /usr/bin/../lib/julia/sys.so (repeats 2 times)
 in complete_line at REPL.jl:279
 in complete_line at LineEdit.jl:141
 in complete_line at LineEdit.jl:139
 in anonymous at LineEdit.jl:1175
 in anonymous at LineEdit.jl:1197
 in prompt_21__3B_1846 at /usr/bin/../lib/julia/sys.so
 in run_interface_3B_1845 at /usr/bin/../lib/julia/sys.so (repeats 2 times)
 in run_frontend_3B_1797 at /usr/bin/../lib/julia/sys.so
 in run_repl_3B_1797 at /usr/bin/../lib/julia/sys.so
 in _start_3B_1707 at /usr/bin/../lib/julia/sys.so (repeats 2 times)

julia  16.55s user 0.23s system 20% cpu 1:23.12 total

I tried a working .4 release and the stable .3 both giving me a similar error.

julia> versioninfo()
Julia Version 0.3.0
Commit 7681878 (2014-08-20 20:43 UTC)
Platform Info:
  System: Linux (x86_64-unknown-linux-gnu)
  CPU: Intel(R) Core(TM) i5-2467M CPU @ 1.60GHz
  WORD_SIZE: 64
  BLAS: libblas
  LAPACK: liblapack
  LIBM: libm
  LLVM: libLLVM-3.3

I am not sure if this is a problem of the packages or a REPL bug so I added it here.

@ivarne
Copy link
Member

ivarne commented Sep 3, 2014

@flpf I think that issue is beeing tracked at #8163. I tried your example on yesterdays master, and it behaves as you described.

@flpf
Copy link

flpf commented Sep 3, 2014

@ivarne I tried the same with a couple of other (smaller) packages like AudioIO, PyCall, DataStructures.... and did not get that error. So I guess the error occurs only with some
packages.

I don't know if this helps in any way but I thought I let you know.
If there is anything I can do to debug that error some more please let me now. But from reading
#8163 I think that this problem is not really traceable for me without diving into julias JITcompile
system.

@flpf
Copy link

flpf commented Sep 6, 2014

@ivarne, @cmcbride.
I did some debugging and found out that my problem originates in the FixedPointNumbers.jl package.
When commenting out the show function in the source file "ufixed.jl" (lines 156-165),
the error is gone.

# Show
function show(io::IO, x::Ufixed)
    print(io, "Ufixed", nbitsfrac(typeof(x)))
    print(io, "(")
    showcompact(io, x)
    print(io, ")")
end
showcompact(io::IO, x::Ufixed) = show(io, round(convert(Float64,x), iceil(nbitsfrac(typeof(x))/_log2_10)))

show{T<:Ufixed}(io::IO, ::Type{T}) = print(io, "Ufixed", nbitsfrac(T))

Maybe you can check if this is the source of the error in your systems as well.
I will file an issue under the FixedPointNumbers.jl package.

@flpf
Copy link

flpf commented Sep 6, 2014

For me the error is fixed after updating FixedPointNumbers.jl.

@Keno
Copy link
Member

Keno commented Dec 29, 2014

I can't reproduce this anymore and the REPL code has had a lot of work.

@Keno Keno closed this as completed Dec 29, 2014
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 REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

No branches or pull requests

5 participants