Skip to content

Juno.@enter exits with error when running PyPlot.plot() #219

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

Closed
zhopan77 opened this issue Mar 26, 2019 · 4 comments
Closed

Juno.@enter exits with error when running PyPlot.plot() #219

zhopan77 opened this issue Mar 26, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@zhopan77
Copy link

zhopan77 commented Mar 26, 2019

I have a very simple script as shown below:

ENV["MPLBACKEND"] = "qt4agg";
using PyPlot

function main()
x = LinRange(0, 3, 10);
y = sin.(x);
plot(x, y);
end

main();

This script runs fine in Juno IDE. Note I have to set up environmental variable MPLBACKEND to "qt4agg" for my Anaconda Python 2.7 matplotlib to work with Julia properly.

However, if I start debugging it by executing
Juno.@Enter main()

I can step until I reach "plot(x, y)", upon executing which the plot shows up (I'm not using Juno plot plane so it's a standalone window), then the debugger exits with the following error message:

julia> Juno.@Enter main()
debug> ERROR: sigatomic_end called in non-sigatomic region
Stacktrace:
[1] #evaluate_call_recurse!#37(::Bool, ::Function, ::Any, ::JuliaInterpreter.Frame, ::Expr) at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\interpret.jl:209
[2] evaluate_call_recurse! at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\interpret.jl:198 [inlined]
[3] eval_rhs(::Any, ::JuliaInterpreter.Frame, ::Expr) at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\interpret.jl:364
[4] step_expr!(::Any, ::JuliaInterpreter.Frame, ::Any, ::Bool) at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\interpret.jl:497
[5] step_expr!(::Any, ::JuliaInterpreter.Frame, ::Bool) at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\interpret.jl:536
[6] finish!(::Any, ::JuliaInterpreter.Frame, ::Bool) at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\commands.jl:14
[7] finish_and_return! at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\commands.jl:29 [inlined]
[8] #evaluate_call_recurse!#37(::Bool, ::Function, ::Any, ::JuliaInterpreter.Frame, ::Expr) at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\interpret.jl:235
... (the last 7 lines are repeated 5 more times)
[44] evaluate_call_recurse! at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\interpret.jl:198 [inlined]
[45] eval_rhs(::Any, ::JuliaInterpreter.Frame, ::Expr) at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\interpret.jl:364
[46] step_expr!(::Any, ::JuliaInterpreter.Frame, ::Any, ::Bool) at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\interpret.jl:492
[47] step_expr!(::Any, ::JuliaInterpreter.Frame, ::Bool) at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\interpret.jl:536
[48] next_line!(::Any, ::JuliaInterpreter.Frame, ::Bool) at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\commands.jl:217
[49] debug_command(::Any, ::JuliaInterpreter.Frame, ::Symbol, ::Bool) at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\commands.jl:424
[50] debug_command at C:\Users\zpan.julia\packages\JuliaInterpreter\8bMSs\src\commands.jl:477 [inlined]
[51] (::getfield(Atom.JunoDebugger, Symbol("##45#47")){Bool})() at C:\Users\zpan.julia\packages\Atom\mngyX\src\debugger\stepper.jl:81
[52] evalscope(::getfield(Atom.JunoDebugger, Symbol("##45#47")){Bool}) at C:\Users\zpan.julia\packages\Atom\mngyX\src\debugger\stepper.jl:315
[53] startdebugging(::JuliaInterpreter.Frame, ::Bool) at C:\Users\zpan.julia\packages\Atom\mngyX\src\debugger\stepper.jl:55

@baggepinnen
Copy link

I'm seeing the same thing with a call to OpenAIGym

@timholy
Copy link
Member

timholy commented Apr 29, 2019

Best workaround would be to temporarily uncomment these lines so you know what's being attempted. Then push! the sigatomic method to JuliaInterpreter.compiled_methods. Some examples are here. You can see a reference to sigatomic Base methods there, but obviously packages that use it can't so easily be guarded.

@tkf
Copy link

tkf commented Apr 30, 2019

It looks like push!(JuliaInterpreter.compiled_modules, PyCall) works: https://discourse.julialang.org/t/debugger-fails-on-pycall/23560/6

@KristofferC
Copy link
Member

"Fixed" upstream in JuliaPy/PyCall.jl#684.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants