JuliaPlots/Plots.jl

[BUG] Plots in VSCode shows no error when it should show

Open

#4,867 建立於 2024年1月16日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)Julia (1,943 star) (381 fork)batch import
GRgood first issue

描述

I'm using VSCode to work with Julia notebooks. When I execute the following code in a fresh new notebook, I expect an error to be shown. Instead, the code yields nothing, not even an error.

using Plots
plot(1:50, 1:30)

However, if I execute the code snippet for 6 times (by clicking the little triangle at the left of the code cell), the following line is shown twice:

attempt to save state beyond implementation limit

If I repeat executing the code, three lines of "attempt to save state beyond implementation limit" keep showing.

When I execute the code snippet in the command line with GR backend, the normal error message is shown.

julia> plot(1:50, 1:30)
Error showing value of type Plots.Plot{Plots.GRBackend}:
ERROR: BoundsError: attempt to access 30-element UnitRange{Int64} at index [1:50]
Stacktrace:
  [1] throw_boundserror(A::UnitRange{Int64}, I::Tuple{UnitRange{Int64}})
...

Backends other than GR seems to have no problem, but I only tested UnicodePlots.

This issue seems to relate to the curious interactions among Julia, VSCode and .ipynb notebook.

I try to search the line of text in GitHub(https://github.com/search?q=%22attempt+to+save+state+beyond+implementation+limit%22&type=code) and see the "attempt to save state beyond implementation limit" line indeed shows up in lib/gr/gr.c.

Details

Backends

This bug occurs on ( insert x below )

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

Versions

Plots.jl version: [91a5bcdd] v1.39.0 Backend version (]st -m <backend(s)>): [28b8d3ca] GR v0.72.8; [b8865327] UnicodePlots v3.6.3 Output of versioninfo():

Julia Version 1.10.0
Commit 3120989f39 (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × AMD Ryzen 7 5800H with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
  Threads: 1 on 16 virtual cores
Environment:
  JULIA_CONDAPKG_BACKEND = Null
  JULIA_PKG_SERVER = https://mirrors.pku.edu.cn/julia
  JULIA_PYTHONCALL_EXE = D:\Programs\mambaforge\envs\torch\python.exe

貢獻者指南