Skip to content

Conversation

@tkf
Copy link
Contributor

@tkf tkf commented Feb 16, 2019

Lately, I've been seeing accidental exit from Julia REPL with error like this:

ERROR: MethodError: Cannot `convert` an object of type Array{Union{Ptr{Nothing}, Base.InterpreterIP},1} to an object of type Bool
Closest candidates are:
  convert(::Type{T<:Number}, ::T<:Number) where T<:Number at number.jl:6
  convert(::Type{T<:Number}, ::Number) where T<:Number at number.jl:7
  convert(::Type{T<:Integer}, ::Ptr) where T<:Integer at pointer.jl:23
  ...
Stacktrace:
 [1] setproperty!(::REPL.LineEditREPL, ::Symbol, ::Array{Union{Ptr{Nothing}, Base.InterpreterIP},1}) at ./Base.jl:19
 [2] print_response(::REPL.AbstractREPL, ::Any, ::Bool, ::Bool) at /home/takafumi/repos/watch/julia/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:139
 [3] (::getfield(REPL, Symbol("#do_respond#38")){Bool,getfield(REPL, Symbol("##48#57")){REPL.LineEditREPL,REPL.REPLHistoryProvider},REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /home/takafumi/repos/watch/julia/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:701
 [4] #invokelatest#1 at ./essentials.jl:761 [inlined]
 [5] invokelatest at ./essentials.jl:760 [inlined]
 [6] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /home/takafumi/repos/watch/julia/usr/share/julia/stdlib/v1.2/REPL/src/LineEdit.jl:2273
 [7] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /home/takafumi/repos/watch/julia/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:1021
 [8] run_repl(::REPL.AbstractREPL, ::Any) at /home/takafumi/repos/watch/julia/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:192
 [9] (::getfield(Base, Symbol("##729#731")){Bool,Bool,Bool,Bool})(::Module) at ./client.jl:402
 [10] #invokelatest#1 at ./essentials.jl:761 [inlined]
 [11] invokelatest at ./essentials.jl:760 [inlined]
 [12] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:386
 [13] exec_options(::Base.JLOptions) at ./client.jl:324
 [14] _start() at ./client.jl:476

I think this is due to the change JuliaLang/julia#30900 in REPL.jl in particular the change in eval_with_backend which now expects a Bool in the second slot:

function eval_with_backend(ast, backend::REPLBackendRef)
    put!(backend.repl_channel, (ast, 1))
    take!(backend.response_channel) # (val, iserr)
end

I think this solves the issue but I haven't looked into the issue carefully enough to find a way to reproduce the issue. However, given the changes in JuliaLang/julia#30900 this change seems to be appropriate.

tkf added 2 commits February 13, 2019 23:07
There is a lag between when `Base.catch_stack` is introduced and is
used in REPL.jl.  Checking `VERSION` is safer.
@codecov
Copy link

codecov bot commented Feb 16, 2019

Codecov Report

Merging #240 into master will increase coverage by 0.3%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #240     +/-   ##
=========================================
+ Coverage   77.83%   78.14%   +0.3%     
=========================================
  Files          11       11             
  Lines        1074     1080      +6     
=========================================
+ Hits          836      844      +8     
+ Misses        238      236      -2
Impacted Files Coverage Δ
src/Revise.jl 69.16% <0%> (+1.18%) ⬆️
src/pkgs.jl 89.28% <0%> (-0.93%) ⬇️
src/parsing.jl 88.99% <0%> (+0.91%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 97d3560...fd7f4c3. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Feb 16, 2019

Codecov Report

Merging #240 into master will increase coverage by 0.3%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #240     +/-   ##
=========================================
+ Coverage   77.83%   78.14%   +0.3%     
=========================================
  Files          11       11             
  Lines        1074     1080      +6     
=========================================
+ Hits          836      844      +8     
+ Misses        238      236      -2
Impacted Files Coverage Δ
src/Revise.jl 69.16% <0%> (+1.18%) ⬆️
src/pkgs.jl 89.28% <0%> (-0.93%) ⬇️
src/parsing.jl 88.99% <0%> (+0.91%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 97d3560...fd7f4c3. Read the comment docs.

@timholy timholy merged commit fad8ce5 into timholy:master Feb 17, 2019
@timholy
Copy link
Owner

timholy commented Feb 17, 2019

This is great, thanks so much!

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

Successfully merging this pull request may close these issues.

2 participants