GR.jl
GR.jl copied to clipboard
Plots.jl with GR backend cause julia crash+hang
This problem has been reported to Plots and VSCODE.
With following code Plots.jl crashes and julia hangs. Julia 1.9.4 on Ubuntu 23.04 + vscode.
The Boston housing dataset is very common and similar visualizations exist e.g. with Seaborn on Python and many packages in R.
Everything works with 11 variables / columns but crashes with >11. As there are no problems in plotly, it may well be that the problem is centred on the gr() backend.
using DataFrames, Plots
using MLDatasets: BostonHousing
dataset = BostonHousing()
df = dataset.features;
df = df[:,1:12];
function correlogram(df)
rows = cols = size(df,2)
plots = []
for row = 1:rows, col = 1:cols
if row == col
push!(
plots,
histogram(df[:,row],bins=10, xtickfont = font(5), ytickfont = font(5), legend = false))
else
push!(
plots,
scatter(df[:,row], df[:,col], xtickfont = font(5), ytickfont = font(5), legend = false, markersize=1, alpha = 0.3, smooth = true,
linewidth=3, linecolor=:red),
)
end
end
plot(plots..., size=(1200, 1000), layout = (rows, cols))
end
correlogram(df)
Before dying julia display the following:
free(): invalid next size (normal)
[760418] signal (6.-6): Aborted
in expression starting at none:0
Please note:
- The problem occurs in
VSCODEwith the above error code. Injupyterlabthe above code just hangs - The problem occurs with gr backend. Plotly backend works in
jupyterlabandVSCODE - The code above works in the
REPL
The problem has been reported to:
https://github.com/JuliaPlots/Plots.jl/issues/4856 https://github.com/JuliaPlots/StatsPlots.jl/issues/547 and https://github.com/julia-vscode/julia-vscode/issues/3518
(see in particular last comments form Plots and VSCODE maintainers, implying responsibility to the crash to GR...)
The problem is fixed with this commit. A new GR release is expected in the next days.