Makie.jl: Segmentation fault for nested plots

Created on 30 Jul 2019  路  11Comments  路  Source: JuliaPlots/Makie.jl

I may be doing this completely wrong and if so please tell me. I want to be able to plot an object, and have that plot actually be two plots inside a vbox. Eventually I want to be able to plot 2x2 of said objects, so that you really have a 4x2 figure (but sometimes the 2x2 will have objects that don't have nested plots, and then the resulting figure would also be 2x2 -- essentially the number and layout of plots will be determined by dispatch). If anyone can tell me how to do this, I would be extremely grateful.

I couldn't figure out how to do this by overriding plot! as a recipe, so I overrode plot. A seg fault ensued, and mercifully the MWE was the first thing I tried:

using AbstractPlotting

struct MyType
  a
  b
end

function AbstractPlotting.plot(mt::MyType, x)
  vbox(
    plot(x, mt.a),
    plot(x, mt.b)
  )
end

mt = MyType(1:10,2:11)

plot(mt, 0:9)
signal (11): Segmentation fault
in expression starting at none:0
_ZN12_GLOBAL__N_113StackColoring22calculateLocalLivenessEv at /home/grahams/.local/opt/julia-1.2.0-rc2/bin/../lib/julia/libLLVM-6.0.so (unknown line)
_ZN12_GLOBAL__N_113StackColoring20runOnMachineFunctionERN4llvm15MachineFunctionE at /home/grahams/.local/opt/julia-1.2.0-rc2/bin/../lib/julia/libLLVM-6.0.so (unknown line)
_ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE at /home/grahams/.local/opt/julia-1.2.0-rc2/bin/../lib/julia/libLLVM-6.0.so (unknown line)
_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE at /home/grahams/.local/opt/julia-1.2.0-rc2/bin/../lib/julia/libLLVM-6.0.so (unknown line)
_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE at /home/grahams/.local/opt/julia-1.2.0-rc2/bin/../lib/julia/libLLVM-6.0.so (unknown line)
_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE at /home/grahams/.local/opt/julia-1.2.0-rc2/bin/../lib/julia/libLLVM-6.0.so (unknown line)
operator() at /buildworker/worker/package_linux64/build/src/jitlayers.cpp:364
addModule at /buildworker/worker/package_linux64/build/usr/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h:57 [inlined]
addModule at /buildworker/worker/package_linux64/build/src/jitlayers.cpp:502
jl_add_to_ee at /buildworker/worker/package_linux64/build/src/jitlayers.cpp:748 [inlined]
jl_finalize_function at /buildworker/worker/package_linux64/build/src/jitlayers.cpp:756
getAddressForFunction at /buildworker/worker/package_linux64/build/src/codegen.cpp:1334
jl_generate_fptr at /buildworker/worker/package_linux64/build/src/codegen.cpp:1426
jl_compile_method_internal at /buildworker/worker/package_linux64/build/src/gf.c:1795
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2196
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1606 [inlined]
jl_f__apply at /buildworker/worker/package_linux64/build/src/builtins.c:563
broadcast_foreach at /home/grahams/.julia/dev/AbstractPlotting.jl/src/utilities/utilities.jl:197
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2197
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1606 [inlined]
jl_f__apply at /buildworker/worker/package_linux64/build/src/builtins.c:563
JuliaPlots/AbstractPlotting.jl#368 at /home/grahams/.julia/dev/AbstractPlotting.jl/src/basic_recipes/basic_recipes.jl:416
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2197
g at /home/grahams/.julia/packages/Observables/qCJWB/src/Observables.jl:136
unknown function (ip: 0x7f958c6df225)
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2197
#setindex!#1 at /home/grahams/.julia/packages/Observables/qCJWB/src/Observables.jl:87
setindex! at /home/grahams/.julia/packages/Observables/qCJWB/src/Observables.jl:83 [inlined]
notify! at /home/grahams/.julia/dev/AbstractPlotting.jl/src/basic_recipes/basic_recipes.jl:387
unknown function (ip: 0x7f95a65dd220)
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2197
plot! at /home/grahams/.julia/dev/AbstractPlotting.jl/src/basic_recipes/basic_recipes.jl:443
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2197
plot! at /home/grahams/.julia/dev/AbstractPlotting.jl/src/interfaces.jl:630
#annotations!#362 at /home/grahams/.julia/dev/AbstractPlotting.jl/src/recipes.jl:15 [inlined]
#annotations! at ./none:0 [inlined]
#TextBuffer#541 at /home/grahams/.julia/dev/AbstractPlotting.jl/src/basic_recipes/buffers.jl:55
TextBuffer at /home/grahams/.julia/dev/AbstractPlotting.jl/src/basic_recipes/buffers.jl:55
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2197
plot! at /home/grahams/.julia/dev/AbstractPlotting.jl/src/basic_recipes/axis.jl:482
#axis2d!#551 at /home/grahams/.julia/dev/AbstractPlotting.jl/src/recipes.jl:21
#axis2d! at ./none:0
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2197
add_axis! at /home/grahams/.julia/dev/AbstractPlotting.jl/src/interfaces.jl:705
plot! at /home/grahams/.julia/dev/AbstractPlotting.jl/src/interfaces.jl:613
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2197
#plot!#195 at /home/grahams/.julia/dev/AbstractPlotting.jl/src/interfaces.jl:564
#plot#189 at /home/grahams/.julia/dev/AbstractPlotting.jl/src/interfaces.jl:533 [inlined]
plot at /home/grahams/.julia/dev/AbstractPlotting.jl/src/recipes.jl:11 [inlined]
plot at ./none:2
unknown function (ip: 0x7f95a6562556)
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2197
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:323
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:411
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:362 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:772
jl_interpret_toplevel_thunk_callback at /buildworker/worker/package_linux64/build/src/interpreter.c:884
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f9591c0718f)
unknown function (ip: (nil))
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:893
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:815
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:844
eval at ./boot.jl:330 [inlined]
repleval at /home/grahams/.julia/packages/Atom/BXRAC/src/repl.jl:135
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2191
JuliaPlots/AbstractPlotting.jl#168 at /home/grahams/.julia/packages/Atom/BXRAC/src/repl.jl:157
with_logstate at ./logging.jl:395
with_logger at ./logging.jl:491 [inlined]
evalrepl at /home/grahams/.julia/packages/Atom/BXRAC/src/repl.jl:148
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2191
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:323
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:411
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:362 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:772
jl_interpret_toplevel_thunk_callback at /buildworker/worker/package_linux64/build/src/interpreter.c:884
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f9591c06e8f)
unknown function (ip: 0xffffffffffffffff)
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:893
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:815
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:844
eval at ./boot.jl:330
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2191
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:86
macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:118 [inlined]
JuliaPlots/AbstractPlotting.jl#26 at ./task.jl:268
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2191
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1606 [inlined]
start_task at /buildworker/worker/package_linux64/build/src/task.c:596
unknown function (ip: 0xffffffffffffffff)
Allocations: 73292656 (Pool: 73284291; Big: 8365); GC: 171

Any advice much appreciated.

AbstractPlotting

All 11 comments

Probably better to use a custom function, the recipe interface doesn't support layouting

That looks like the wrong overload.
I'm guessing, that this is a hidden stack overflow - although this actually works for me on GLMakie#master & AbstractPlotting#master

Can confirm this works on master.

On further testing, it only segfaults when I'm using the Atom REPL. (tested both 1.2-rc2 and 1.3-alpha; using AbstractPlotting#master, GLMakie#master, and Makie#master)

@pfitzseb we have another instance of this issue...are you on MacOS @grahamas?

No, I'm on Arch Linux, using the Atom release binary (v1.38.2). (also on Ubuntu half the time; not sure if it errors there yet)

What version of julia-client are you running, @grahamas? Updating Atom to 1.39.1 (which should be the latest version in the arch repos) might or might not help. I'll try this locally as soon as I can. Also, what Julia version are you on?

@pfitzseb my julia-client is 0.8.10. I updated Atom to 1.39.1 as suggested but the problem persists. For Julia I've tried both 1.2-rc2 and 1.3-alpha. I could also try a stable version if you'd like.

The stack trace points to a julia compilation error...

This is in Atom...same issue as earlier. Does it work with Julia 1.3 and the latest Juno ecosystem?

You should cross post this to julialang... Maybe, this is related: https://github.com/JuliaLang/julia/issues/30802

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DoktorMike picture DoktorMike  路  6Comments

EricForgy picture EricForgy  路  5Comments

Photonico picture Photonico  路  3Comments

SebastianM-C picture SebastianM-C  路  3Comments

asinghvi17 picture asinghvi17  路  5Comments