Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault when width is unspecified in legend position #827

Closed
adigitoleo opened this issue Feb 7, 2022 · 3 comments
Closed

Segfault when width is unspecified in legend position #827

adigitoleo opened this issue Feb 7, 2022 · 3 comments

Comments

@adigitoleo
Copy link

Affects both modern mode and classic mode. The following snippet plots correctly if any width parameter is added inside position.

julia> legend(
           region = (0, 10, 0, 8),
           (;
               symbol1 = (;
                   dx_left = 0.25,
                   marker = "-",
                   size = 0.33,
                   pen = 2,
                   fill = :black,
                   dx_right = 0.75,
                   text = "1s delay time",
               ),
               symbol2 = (;
                   dx_left = 0.25,
                   marker = :star,
                   size = 0.5,
                   pen = :false,
                   fill = :yellow,
                   dx_right = 0.75,
                   text = "Epicentre",
               ),
           ),
           position = (; inside = :BL, anchor = :BL),
           box = (; pen = 0.5),
       )

signal (11): Segmentation fault
in expression starting at REPL[17]:1
GMT_pslegend at /usr/lib/libgmt.so (unknown line)
GMT_Call_Module at /usr/lib/libgmt.so (unknown line)
GMT_Call_Module at /home/admin/.julia/packages/GMT/jguOm/src/libgmt.jl:147 [inlined]
gmt at /home/admin/.julia/packages/GMT/jguOm/src/gmt_main.jl:292
finish_PS_module at /home/admin/.julia/packages/GMT/jguOm/src/common_options.jl:3533
finish_PS_module at /home/admin/.julia/packages/GMT/jguOm/src/common_options.jl:3473 [inlined]
#legend#397 at /home/admin/.julia/packages/GMT/jguOm/src/pslegend.jl:65
legend##kw at /home/admin/.julia/packages/GMT/jguOm/src/pslegend.jl:51 [inlined]
#legend#403 at /home/admin/.julia/packages/GMT/jguOm/src/pslegend.jl:219 [inlined]
legend##kw at /home/admin/.julia/packages/GMT/jguOm/src/pslegend.jl:219
unknown function (ip: 0x7efc0d528b56)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:126
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:215
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:166 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:587
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:731
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:885
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:830
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:944
eval at ./boot.jl:373 [inlined]
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:150
repl_backend_loop at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:244
start_repl_backend at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:229
#run_repl#47 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:362
run_repl at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:349
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
#930 at ./client.jl:394
jfptr_YY.930_40362.clone_1 at /usr/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
jl_f__call_latest at /buildworker/worker/package_linux64/build/src/builtins.c:757
#invokelatest#2 at ./essentials.jl:716 [inlined]
invokelatest at ./essentials.jl:714 [inlined]
run_main_repl at ./client.jl:379
exec_options at ./client.jl:309
_start at ./client.jl:495
jfptr__start_40531.clone_1 at /usr/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
true_main at /buildworker/worker/package_linux64/build/src/jlapi.c:559
jl_repl_entrypoint at /buildworker/worker/package_linux64/build/src/jlapi.c:701
main at julia (unknown line)
__libc_start_main at /usr/bin/../lib/libc.so.6 (unknown line)
unknown function (ip: 0x400808)
Allocations: 12158722 (Pool: 12153201; Big: 5521); GC: 14

^C
zsh: segmentation fault (core dumped)  julia --banner=no --project=$PWD
@joa-quim
Copy link
Member

joa-quim commented Feb 7, 2022

Yes, shared guilty. GMT should check it to avoid the crash (opened an issue) and GMT.jl should error when not provided.
The fact is, the width is a mandatory argument.

@joa-quim
Copy link
Member

joa-quim commented Feb 7, 2022

Dealt with in #829

@joa-quim
Copy link
Member

joa-quim commented Feb 8, 2022

FYI, I've reverted the need for a width in #832
In fact GMT can compute it ... if we don't feed it with a GMTdataset with an empty coordinates matrix. Part of it discussed in GenericMappingTools/gmt#6313

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants