JuliaPlots / Plots.jl

Powerful convenience for Julia visualizations and data analysis
https://docs.juliaplots.org
Other
1.84k stars 354 forks source link

[BUG] CTRL + C during Plot Loop Breaks Plots.jl, Julia Hangs Up #4276

Open Jimbo-Coder opened 2 years ago

Jimbo-Coder commented 2 years ago

Details

CTRL + C during a Loop that was generating heatmaps, the loop was displaying 500-1000 heatmaps one after another very smoothly. I was pressing CTRL + C while the loop was displaying, and it corrupted Plots.jl somehow. Calling plot(1:10) will cause Julia to hangup, it will not produce any plot and will not continue to the next line of the REPL. It will remain stuck and further inputs of CTRL + C do not help it.

Weirdly, this bug still exists after removing Plots as a package, updating it, and reinstalling it. Calling plot(1:10) will crash julia. Further testing has led me to believe it has something to do with CTRL + C while leaving the Plot window open.

I am not sure if leaving the window open or closing it during an interrupted loop will create the bug. Also I am not sure if the loop of Plots plays into the bug or if it is caused by just leaving the plot window open.

I believe it is related to the send: Broken Pipe bug. https://discourse.julialang.org/t/plot-jl-throws-broken-pipe-after-closing-window-with-gr-backend/35873

It seems closeall() is the fix, but am not sure.

This bug occurs on ( insert x below )

Backend yes no untested
gr (default) x
pyplot x
plotlyjs x
pgfplotsx x
unicodeplots x
inspectdr x
gaston x

Versions

Plots.jl version: 1.31.2 Backend version (]st -m <backend(s)>): GR v0.66.0 Output of versioninfo():

Julia Version 1.7.3 Commit 742b9abb4d (2022-05-06 12:58 UTC) Platform Info: OS: Windows (x86_64-w64-mingw32) CPU: AMD Ryzen 7 5800X 8-Core Processor WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-12.0.1 (ORCJIT, znver3)

BeastyBlacksmith commented 2 years ago

probably a duplicate of https://github.com/JuliaPlots/Plots.jl/issues/4256