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 in _glfwGetMonitorPosX11 during GLMakie precompile #239

Open
xvries opened this issue Jul 18, 2024 · 7 comments
Open

Segfault in _glfwGetMonitorPosX11 during GLMakie precompile #239

xvries opened this issue Jul 18, 2024 · 7 comments

Comments

@xvries
Copy link

xvries commented Jul 18, 2024

Running into a segfault when precompiling GLMakie using X11 forwarding (headless server).

[32347] signal (11.1): Segmentation fault
in expression starting at /hpc/home/xvries/.julia/packages/Makie/rEu75/precompile/shared-precompile.jl:4
_glfwGetMonitorPosX11 at /hpc/home/xvries/.julia/artifacts/3643539f491c217e13c1595daad81dd1426fba07/lib/libglfw.so (unknown line)
GetMonitorPos at /hpc/home/xvries/.julia/packages/GLFW/wmoTL/src/glfw3.jl:529
MonitorProperties at /hpc/home/xvries/.julia/packages/GLMakie/z5T26/src/glwindow.jl:180
window_area at /hpc/home/xvries/.julia/packages/GLMakie/z5T26/src/events.jl:45
connect_screen at /hpc/home/xvries/.julia/packages/Makie/rEu75/src/interaction/events.jl:20
display_scene! at /hpc/home/xvries/.julia/packages/GLMakie/z5T26/src/screen.jl:413
unknown function (ip: 0x2aab01cd8629)
_jl_invoke at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:3077
#Screen#45 at /hpc/home/xvries/.julia/packages/GLMakie/z5T26/src/screen.jl:428
Screen at /hpc/home/xvries/.julia/packages/GLMakie/z5T26/src/screen.jl:424
unknown function (ip: 0x2aaac8cdcf1c)
_jl_invoke at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:3077
getscreen at /hpc/home/xvries/.julia/packages/Makie/rEu75/src/display.jl:427
#colorbuffer#1358 at /hpc/home/xvries/.julia/packages/Makie/rEu75/src/display.jl:465
colorbuffer at /hpc/home/xvries/.julia/packages/Makie/rEu75/src/display.jl:457 [inlined]
colorbuffer at /hpc/home/xvries/.julia/packages/Makie/rEu75/src/display.jl:457
unknown function (ip: 0x2aaac8cb2065)
_jl_invoke at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
do_call at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:126
eval_value at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:223
eval_stmt_value at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:174 [inlined]
eval_body at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:617
jl_interpret_toplevel_thunk at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:775
jl_toplevel_eval_flex at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/toplevel.c:934
jl_toplevel_eval_flex at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/toplevel.c:877
ijl_toplevel_eval_in at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/toplevel.c:985
eval at ./boot.jl:385 [inlined]
include_string at ./loading.jl:2076
_jl_invoke at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:3077
_include at ./loading.jl:2136
include at ./Base.jl:495
jfptr_include_46393.1 at /hpc/home/xvries/Desktop/julia-1.10.4/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
jl_f__call_latest at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/builtins.c:812
include at /hpc/home/xvries/.julia/packages/GLMakie/z5T26/src/GLMakie.jl:1 [inlined]
macro expansion at /hpc/home/xvries/.julia/packages/GLMakie/z5T26/src/precompiles.jl:27 [inlined]
macro expansion at /hpc/home/xvries/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:78 [inlined]
macro expansion at /hpc/home/xvries/.julia/packages/GLMakie/z5T26/src/precompiles.jl:18 [inlined]
macro expansion at /hpc/home/xvries/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:140 [inlined]
top-level scope at /hpc/home/xvries/.julia/packages/GLMakie/z5T26/src/precompiles.jl:16
jl_toplevel_eval_flex at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/toplevel.c:925
jl_toplevel_eval_flex at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/toplevel.c:877
ijl_toplevel_eval_in at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/toplevel.c:985
eval at ./boot.jl:385 [inlined]
include_string at ./loading.jl:2076
_jl_invoke at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:3077
_include at ./loading.jl:2136
include at ./Base.jl:495
jfptr_include_46393.1 at /hpc/home/xvries/Desktop/julia-1.10.4/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
jl_f__call_latest at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/builtins.c:812
include at /hpc/home/xvries/.julia/packages/GLMakie/z5T26/src/GLMakie.jl:1
unknown function (ip: 0x2aaac8bfa495)
_jl_invoke at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
do_call at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:126
eval_value at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:223
eval_stmt_value at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:174 [inlined]
eval_body at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:617
jl_interpret_toplevel_thunk at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:775
jl_toplevel_eval_flex at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/toplevel.c:934
jl_eval_module_expr at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/toplevel.c:215 [inlined]
jl_toplevel_eval_flex at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/toplevel.c:736
jl_toplevel_eval_flex at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/toplevel.c:877
ijl_toplevel_eval_in at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/toplevel.c:985
eval at ./boot.jl:385 [inlined]
include_string at ./loading.jl:2076
_jl_invoke at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:3077
_include at ./loading.jl:2136
include at ./Base.jl:495 [inlined]
include_package_for_output at ./loading.jl:2222
jfptr_include_package_for_output_81013.1 at /hpc/home/xvries/Desktop/julia-1.10.4/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
do_call at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:126
eval_value at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:223
eval_stmt_value at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:174 [inlined]
eval_body at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:617
jl_interpret_toplevel_thunk at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/interpreter.c:775
jl_toplevel_eval_flex at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/toplevel.c:934
jl_toplevel_eval_flex at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/toplevel.c:877
ijl_toplevel_eval_in at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/toplevel.c:985
eval at ./boot.jl:385 [inlined]
include_string at ./loading.jl:2076
include_string at ./loading.jl:2086 [inlined]
exec_options at ./client.jl:316
_start at ./client.jl:552
jfptr__start_82729.1 at /hpc/home/xvries/Desktop/julia-1.10.4/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
true_main at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/jlapi.c:582
jl_repl_entrypoint at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/src/jlapi.c:731
main at /cache/build/builder-amdci4-0/julialang/julia-release-1-dot-10/cli/loader_exe.c:58
__libc_start_main at /lib64/libc.so.6 (unknown line)
unknown function (ip: 0x4010b8)
Allocations: 36508334 (Pool: 36485586; Big: 22748); GC: 57
ERROR: Failed to precompile GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a] to "/hpc/home/xvries/.julia/compiled/v1.10/GLMakie/jl_RgbxIs".

Any idea on how to solve?

@SimonDanisch
Copy link
Member

#/hpc/home/xvries/.julia/packages/GLFW/wmoTL/src/glfw3.jl:529
function GetMonitorPos(monitor::Monitor)
	x, y = Ref{Cint}(), Ref{Cint}()
	ccall((:glfwGetMonitorPos, libglfw), Cvoid, (Monitor, Ref{Cint}, Ref{Cint}), monitor, x, y)
	(x=x[], y=y[])
end

I guess Monitor is NULL here or something?

@xvries
Copy link
Author

xvries commented Jul 18, 2024

I did set:
ENV["DISPLAY"]=":0"

@SimonDanisch
Copy link
Member

SimonDanisch commented Jul 18, 2024

Well, doesn't mean Monitor cant be null.
If you have a chance to debug this, I'd check monitor.handle in the linked function:
https://github.com/JuliaGL/GLFW.jl/blob/master/src/glfw3.jl#L527-L531

@xvries
Copy link
Author

xvries commented Jul 18, 2024

Monitor.handle equals Ptr{Nothing} @0x0000000000000. So I guess its indeed null. Is this a problem in my X11 setup?

@SimonDanisch
Copy link
Member

You can try to check for null and if null return (x=0, y=0) and see if that fixes it.

@xvries
Copy link
Author

xvries commented Jul 18, 2024

I tried but the segfault reappears in the GetMonitorPhysicalSize and after that in the GetVideoMode for that last one I don't know what would be the defaults :).

@SimonDanisch
Copy link
Member

Hm, maybe you can fix it closer to the root of the issue?
E.g. check here for null:
https://github.com/MakieOrg/Makie.jl/blob/master/GLMakie/src/glwindow.jl#L177-L188
And then just insert some defaults for the properties.
I think we only need it for dpi/scalefactor, so the rest can be something like 0.
I guess for dpi as a default we could use something like 90

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