jheinen / GR.jl

Plotting for Julia based on GR, a framework for visualisation applications
Other
356 stars 76 forks source link

local `Plots` tests segfault on `GR3` #480

Open t-bltg opened 2 years ago

t-bltg commented 2 years ago
(@v1.8) pkg> test Plots
[...]
[ Info: Testing plot: gr:50:3D surface with axis guides

signal (11): Segmentation fault
in expression starting at none:1
gr3_init at [...]/artifacts/26099abd23e11fc440259049997307380be745c8/lib/libGR3.so (unknown line)
gr3_createindexedmesh_nocopy at [...]/artifacts/26099abd23e11fc440259049997307380be745c8/lib/libGR3.so (unknown line)
gr3_createsurfacemesh at [...]/artifacts/26099abd23e11fc440259049997307380be745c8/lib/libGR3.so (unknown line)
gr3_surface at [...]/artifacts/26099abd23e11fc440259049997307380be745c8/lib/libGR3.so (unknown line)
surface at [...]/.julia/packages/GR/uzy0J/src/gr3.jl:362
unknown function (ip: 0x7f7cb236dbd8)
gr_draw_surface at [...]/.julia/packages/Plots/AAjgN/src/backends/gr.jl:2073
unknown function (ip: 0x7f7cb235532f)
gr_add_series at [...]/.julia/packages/Plots/AAjgN/src/backends/gr.jl:1898
gr_display at [...]/.julia/packages/Plots/AAjgN/src/backends/gr.jl:1035
unknown function (ip: 0x7f7cb271fdff)
gr_display at [...]/.julia/packages/Plots/AAjgN/src/backends/gr.jl:700
#453 at [...]/.julia/packages/Plots/AAjgN/src/backends/gr.jl:2193 [inlined]
withenv at ./env.jl:172
_show at [...]/.julia/packages/Plots/AAjgN/src/backends/gr.jl:2188
jl_apply at [...]/src/julia.h:1839 [inlined]
jl_f__call_latest at [...]/src/builtins.c:774
#invokelatest#2 at ./essentials.jl:729 [inlined]
invokelatest at ./essentials.jl:726 [inlined]
show at [...]/.julia/packages/Plots/AAjgN/src/output.jl:227 [inlined]
#284 at [...]/.julia/packages/Plots/AAjgN/src/output.jl:6 [inlined]
#open#378 at ./io.jl:384
open at ./io.jl:381
png at [...]/.julia/packages/Plots/AAjgN/src/output.jl:4 [inlined]
png at [...]/.julia/packages/Plots/AAjgN/src/output.jl:8
unknown function (ip: 0x7f7cb2bcbba6)
jl_apply at [...]/src/julia.h:1839 [inlined]
do_call at [...]/src/interpreter.c:126
eval_value at [...]/src/interpreter.c:215
eval_stmt_value at [...]/src/interpreter.c:166 [inlined]
eval_body at [...]/src/interpreter.c:612
jl_interpret_toplevel_thunk at [...]/src/interpreter.c:750
jl_toplevel_eval_flex at [...]/src/toplevel.c:906
ijl_toplevel_eval_in at [...]/src/toplevel.c:965
eval at ./boot.jl:368 [inlined]
eval at ./Base.jl:65 [inlined]
#247 at [...]/.julia/packages/Plots/AAjgN/test/test_backends.jl:90
unknown function (ip: 0x7f7cb2f0b356)
jl_apply at [...]/src/julia.h:1839 [inlined]
do_apply at [...]/src/builtins.c:730
#test_images#8 at [...]/.julia/packages/VisualRegressionTests/QCeB4/src/imgcomp.jl:51
test_images##kw at [...]/.julia/packages/VisualRegressionTests/QCeB4/src/imgcomp.jl:50 [inlined]
#image_comparison_tests#246 at [...]/.julia/packages/Plots/AAjgN/test/test_backends.jl:94
image_comparison_tests##kw at [...]/.julia/packages/Plots/AAjgN/test/test_backends.jl:62 [inlined]
macro expansion at [...]/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:464 [inlined]
#image_comparison_facts#249 at [...]/.julia/packages/Plots/AAjgN/test/test_backends.jl:114
image_comparison_facts##kw at [...]/.julia/packages/Plots/AAjgN/test/test_backends.jl:103
unknown function (ip: 0x7f7cb2f0aa85)
#254 at [...]/.julia/packages/Plots/AAjgN/test/test_backends.jl:189
#with#57 at [...]/.julia/packages/Plots/AAjgN/src/utils.jl:698
with at [...]/.julia/packages/Plots/AAjgN/src/utils.jl:637
jheinen commented 2 years ago

I cannot reproduce this fault on macOS arm64. Which platform/versions did you use?

t-bltg commented 2 years ago
julia> versioninfo()
Julia Version 1.8.2
Commit 36034abf26* (2022-09-29 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 32 × Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libm
  LLVM: libLLVM-13.0.1 (ORCJIT, sandybridge)
  Threads: 1 on 32 virtual cores

Working remotely on ssh.

t-bltg commented 2 years ago

Weird, I've just rebooted, deleted the GR artifact, ] instantiate, and this works now.

t-bltg commented 1 year ago

@jheinen, I'm having this issue again, with GR segfaulting locally during ] test Plots always on this example.

I think it might be related to the volume segfaults noted in https://github.com/jheinen/GR.jl/pull/488#issue-1434684096 or https://github.com/jheinen/GR.jl/pull/483#issuecomment-1301642238.

Maybed related to https://github.com/jheinen/GR.jl/issues/322.

terasakisatoshi commented 1 year ago

Have you tried to add xvfb-run before julia command ? For example:

$ xvfb-run julia --project=@. -e 'using Pkg; Pkg.test("Plots")'
jheinen commented 1 year ago

Actually, I thought xfvb was already used - at least it is specified that way in the workflow.

t-bltg commented 1 year ago

This is not related to xvfb-run. In my workflow, I observe that it usually happen after a ctrl+c on Plots tests, and upon re-running the tests after interrupting them. Then, the issue just repeats (segfaults) with regular Plots commands in the REPL or in tests (even after a julia restart). This tends to indicate a corruption of the library on the disk somehow. Deleting the GR artifacts folder, and running instantiate (downloading the artifact again) immediately solves the issue (but it can still be segfault after, I just need to re-delete / re-download the artifact again). Always observed in libGR3 and on the same example in the Plots test suite.