Segfault in simple-egl example
I am not sure if this issue is in weston or in the wayland-client library, but since this is a weston example I will put it here for now.
When I am trying to run the simple-egl example I get a segfault at wl_shell_get_shell_surface. I tried that in weston and in hyprland with the same result. The example works fine on my workcomputer. It uses wslg in WSL. I don't have access to it right now since it's a sunday, but tommorow I can chech wether it has a different wayland-client version. But on the computer where it segfaults I got wayland-1.23.1.
(gdb) run
Starting program: /home/pascal/dev/wayland_test/test
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffebc006c0 (LWP 13747)]
[New Thread 0x7fffeb2006c0 (LWP 13748)]
[New Thread 0x7fffea8006c0 (LWP 13749)]
[New Thread 0x7fffe9e006c0 (LWP 13750)]
[New Thread 0x7fffe90006c0 (LWP 13751)]
[New Thread 0x7fffe3e006c0 (LWP 13752)]
[New Thread 0x7fffe34006c0 (LWP 13753)]
[New Thread 0x7fffe2a006c0 (LWP 13754)]
[New Thread 0x7fffe20006c0 (LWP 13755)]
Thread 1 "test" received signal SIGSEGV, Segmentation fault.
0x00007ffff7f86754 in wl_proxy_get_version () from /usr/lib64/libwayland-client.so.0
(gdb) bt
#0 0x00007ffff7f86754 in wl_proxy_get_version () from /usr/lib64/libwayland-client.so.0
#1 0x0000555555556ad7 in wl_shell_get_shell_surface (wl_shell=0x0, surface=0x5555558d6cf0) at /usr/include/wayland-client-protocol.h:3165
#2 0x00005555555578f9 in create_surface (window=0x7fffffffcde0) at test.c:306
#3 0x00005555555586e0 in main (argc=1, argv=0x7fffffffd078) at test.c:653
Heres is the output on what it is linked against
~/dev/wayland_test via v14.2.1-gcc ➜ ldd simple-egl took 4m47s
linux-vdso.so.1 (0x00007f5dbdaba000)
libwayland-client.so.0 => /usr/lib64/libwayland-client.so.0 (0x00007f5dbda6d000)
libEGL.so.1 => /usr/lib64/libEGL.so.1 (0x00007f5dbda57000)
libwayland-egl.so.1 => /usr/lib64/libwayland-egl.so.1 (0x00007f5dbda52000)
libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007f5dbd9df000)
libwayland-cursor.so.0 => /usr/lib64/libwayland-cursor.so.0 (0x00007f5dbd9d6000)
libm.so.6 => /lib64/libm.so.6 (0x00007f5dbd926000)
libc.so.6 => /lib64/libc.so.6 (0x00007f5dbd74b000)
libffi.so.8 => /usr/lib64/libffi.so.8 (0x00007f5dbd73e000)
libGLdispatch.so.0 => /usr/lib64/libGLdispatch.so.0 (0x00007f5dbd6c4000)
libGLX.so.0 => /usr/lib64/libGLX.so.0 (0x00007f5dbd691000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5dbdabc000)
libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f5dbd549000)
libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f5dbd51b000)
libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f5dbd515000)
libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007f5dbd50d000)
Here is the output when I run it with WAYLAND_DEBUG=1
~/dev/wayland_test via v14.2.1-gcc ➜ WAYLAND_DEBUG=1 ./simple-egl took 150ms
[3171888.501] {Default Queue} -> wl_display#1.get_registry(new id wl_registry#2)
[3171888.574] {Default Queue} wl_registry#2.global(1, "wl_seat", 9)
[3171888.590] {Default Queue} -> wl_registry#2.bind(1, "wl_seat", 1, new id [unknown]#3)
[3171888.596] {Default Queue} wl_registry#2.global(2, "wl_data_device_manager", 3)
[3171888.599] {Default Queue} wl_registry#2.global(3, "wl_compositor", 6)
[3171888.602] {Default Queue} -> wl_registry#2.bind(3, "wl_compositor", 1, new id [unknown]#4)
[3171888.606] {Default Queue} wl_registry#2.global(4, "wl_subcompositor", 1)
[3171888.609] {Default Queue} wl_registry#2.global(5, "wl_shm", 1)
[3171888.612] {Default Queue} -> wl_registry#2.bind(5, "wl_shm", 1, new id [unknown]#5)
[3171888.636] {Default Queue} -> wl_shm#5.create_pool(new id wl_shm_pool#6, fd 5, 4096)
[3171889.234] {Default Queue} -> wl_shm_pool#6.resize(14592)
[3171889.261] {Default Queue} -> wl_shm_pool#6.resize(35584)
[3171889.290] {Default Queue} -> wl_shm_pool#6.resize(77568)
[3171889.342] {Default Queue} -> wl_shm_pool#6.resize(161536)
[3171889.984] {Default Queue} -> wl_shm_pool#6.resize(329472)
[3171890.637] {Default Queue} -> wl_shm_pool#6.resize(665344)
[3171891.726] {Default Queue} -> wl_shm_pool#6.resize(1337088)
[3171894.581] {Default Queue} -> wl_shm_pool#6.resize(2680576)
[3171896.610] {Default Queue} wl_registry#2.global(6, "wp_viewporter", 1)
[3171896.617] {Default Queue} wl_registry#2.global(7, "wp_tearing_control_manager_v1", 1)
[3171896.622] {Default Queue} wl_registry#2.global(8, "wp_fractional_scale_manager_v1", 1)
[3171896.626] {Default Queue} wl_registry#2.global(9, "zxdg_output_manager_v1", 3)
[3171896.630] {Default Queue} wl_registry#2.global(10, "wp_cursor_shape_manager_v1", 1)
[3171896.632] {Default Queue} wl_registry#2.global(11, "zwp_idle_inhibit_manager_v1", 1)
[3171896.635] {Default Queue} wl_registry#2.global(12, "zwp_relative_pointer_manager_v1", 1)
[3171896.640] {Default Queue} wl_registry#2.global(13, "zxdg_decoration_manager_v1", 1)
[3171896.644] {Default Queue} wl_registry#2.global(14, "wp_alpha_modifier_v1", 1)
[3171896.647] {Default Queue} wl_registry#2.global(15, "zwlr_gamma_control_manager_v1", 1)
[3171896.651] {Default Queue} wl_registry#2.global(16, "ext_foreign_toplevel_list_v1", 1)
[3171896.654] {Default Queue} wl_registry#2.global(17, "zwp_pointer_gestures_v1", 3)
[3171896.658] {Default Queue} wl_registry#2.global(18, "zwlr_foreign_toplevel_manager_v1", 3)
[3171896.662] {Default Queue} wl_registry#2.global(19, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[3171896.666] {Default Queue} wl_registry#2.global(20, "zwp_text_input_manager_v1", 1)
[3171896.670] {Default Queue} wl_registry#2.global(21, "zwp_text_input_manager_v3", 1)
[3171896.673] {Default Queue} wl_registry#2.global(22, "zwp_pointer_constraints_v1", 1)
[3171896.678] {Default Queue} wl_registry#2.global(23, "zwlr_output_power_manager_v1", 1)
[3171896.681] {Default Queue} wl_registry#2.global(24, "xdg_activation_v1", 1)
[3171896.684] {Default Queue} wl_registry#2.global(25, "ext_idle_notifier_v1", 1)
[3171896.688] {Default Queue} wl_registry#2.global(26, "ext_session_lock_manager_v1", 1)
[3171896.692] {Default Queue} wl_registry#2.global(27, "zwp_input_method_manager_v2", 1)
[3171896.695] {Default Queue} wl_registry#2.global(28, "zwp_virtual_keyboard_manager_v1", 1)
[3171896.699] {Default Queue} wl_registry#2.global(29, "zwlr_virtual_pointer_manager_v1", 2)
[3171896.702] {Default Queue} wl_registry#2.global(30, "zwlr_output_manager_v1", 4)
[3171896.706] {Default Queue} wl_registry#2.global(31, "org_kde_kwin_server_decoration_manager", 1)
[3171896.709] {Default Queue} wl_registry#2.global(32, "hyprland_focus_grab_manager_v1", 1)
[3171896.712] {Default Queue} wl_registry#2.global(33, "zwp_tablet_manager_v2", 1)
[3171896.716] {Default Queue} wl_registry#2.global(34, "zwlr_layer_shell_v1", 5)
[3171896.719] {Default Queue} wl_registry#2.global(35, "wp_presentation", 1)
[3171896.723] {Default Queue} wl_registry#2.global(36, "xdg_wm_base", 6)
[3171896.726] {Default Queue} wl_registry#2.global(37, "zwlr_data_control_manager_v1", 2)
[3171896.730] {Default Queue} wl_registry#2.global(38, "zwp_primary_selection_device_manager_v1", 1)
[3171896.734] {Default Queue} wl_registry#2.global(39, "xwayland_shell_v1", 1)
[3171896.737] {Default Queue} wl_registry#2.global(40, "zwlr_screencopy_manager_v1", 3)
[3171896.741] {Default Queue} wl_registry#2.global(41, "hyprland_toplevel_export_manager_v1", 2)
[3171896.744] {Default Queue} wl_registry#2.global(42, "hyprland_global_shortcuts_manager_v1", 1)
[3171896.748] {Default Queue} wl_registry#2.global(43, "xdg_dialog_v1", 1)
[3171896.751] {Default Queue} wl_registry#2.global(44, "wp_drm_lease_device_v1", 1)
[3171896.755] {Default Queue} wl_registry#2.global(45, "wp_linux_drm_syncobj_manager_v1", 1)
[3171896.758] {Default Queue} wl_registry#2.global(46, "wl_drm", 2)
[3171896.762] {Default Queue} wl_registry#2.global(47, "zwp_linux_dmabuf_v1", 5)
[3171896.765] {Default Queue} wl_registry#2.global(48, "wl_output", 4)
[3171907.220] {mesa egl display queue} -> wl_display#1.get_registry(new id wl_registry#7)
[3171907.230] {mesa egl display queue} -> wl_display#1.sync(new id wl_callback#8)
[3171907.386] {Display Queue} wl_display#1.delete_id(8)
[3171907.390] {mesa egl display queue} wl_registry#7.global(1, "wl_seat", 9)
[3171907.395] {mesa egl display queue} wl_registry#7.global(2, "wl_data_device_manager", 3)
[3171907.398] {mesa egl display queue} wl_registry#7.global(3, "wl_compositor", 6)
[3171907.402] {mesa egl display queue} wl_registry#7.global(4, "wl_subcompositor", 1)
[3171907.406] {mesa egl display queue} wl_registry#7.global(5, "wl_shm", 1)
[3171907.409] {mesa egl display queue} wl_registry#7.global(6, "wp_viewporter", 1)
[3171907.414] {mesa egl display queue} wl_registry#7.global(7, "wp_tearing_control_manager_v1", 1)
[3171907.419] {mesa egl display queue} wl_registry#7.global(8, "wp_fractional_scale_manager_v1", 1)
[3171907.423] {mesa egl display queue} wl_registry#7.global(9, "zxdg_output_manager_v1", 3)
[3171907.427] {mesa egl display queue} wl_registry#7.global(10, "wp_cursor_shape_manager_v1", 1)
[3171907.430] {mesa egl display queue} wl_registry#7.global(11, "zwp_idle_inhibit_manager_v1", 1)
[3171907.435] {mesa egl display queue} wl_registry#7.global(12, "zwp_relative_pointer_manager_v1", 1)
[3171907.438] {mesa egl display queue} wl_registry#7.global(13, "zxdg_decoration_manager_v1", 1)
[3171907.442] {mesa egl display queue} wl_registry#7.global(14, "wp_alpha_modifier_v1", 1)
[3171907.445] {mesa egl display queue} wl_registry#7.global(15, "zwlr_gamma_control_manager_v1", 1)
[3171907.449] {mesa egl display queue} wl_registry#7.global(16, "ext_foreign_toplevel_list_v1", 1)
[3171907.452] {mesa egl display queue} wl_registry#7.global(17, "zwp_pointer_gestures_v1", 3)
[3171907.455] {mesa egl display queue} wl_registry#7.global(18, "zwlr_foreign_toplevel_manager_v1", 3)
[3171907.459] {mesa egl display queue} wl_registry#7.global(19, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[3171907.463] {mesa egl display queue} wl_registry#7.global(20, "zwp_text_input_manager_v1", 1)
[3171907.467] {mesa egl display queue} wl_registry#7.global(21, "zwp_text_input_manager_v3", 1)
[3171907.470] {mesa egl display queue} wl_registry#7.global(22, "zwp_pointer_constraints_v1", 1)
[3171907.474] {mesa egl display queue} wl_registry#7.global(23, "zwlr_output_power_manager_v1", 1)
[3171907.478] {mesa egl display queue} wl_registry#7.global(24, "xdg_activation_v1", 1)
[3171907.481] {mesa egl display queue} wl_registry#7.global(25, "ext_idle_notifier_v1", 1)
[3171907.484] {mesa egl display queue} wl_registry#7.global(26, "ext_session_lock_manager_v1", 1)
[3171907.488] {mesa egl display queue} wl_registry#7.global(27, "zwp_input_method_manager_v2", 1)
[3171907.492] {mesa egl display queue} wl_registry#7.global(28, "zwp_virtual_keyboard_manager_v1", 1)
[3171907.495] {mesa egl display queue} wl_registry#7.global(29, "zwlr_virtual_pointer_manager_v1", 2)
[3171907.499] {mesa egl display queue} wl_registry#7.global(30, "zwlr_output_manager_v1", 4)
[3171907.503] {mesa egl display queue} wl_registry#7.global(31, "org_kde_kwin_server_decoration_manager", 1)
[3171907.506] {mesa egl display queue} wl_registry#7.global(32, "hyprland_focus_grab_manager_v1", 1)
[3171907.510] {mesa egl display queue} wl_registry#7.global(33, "zwp_tablet_manager_v2", 1)
[3171907.513] {mesa egl display queue} wl_registry#7.global(34, "zwlr_layer_shell_v1", 5)
[3171907.516] {mesa egl display queue} wl_registry#7.global(35, "wp_presentation", 1)
[3171907.520] {mesa egl display queue} wl_registry#7.global(36, "xdg_wm_base", 6)
[3171907.523] {mesa egl display queue} wl_registry#7.global(37, "zwlr_data_control_manager_v1", 2)
[3171907.526] {mesa egl display queue} wl_registry#7.global(38, "zwp_primary_selection_device_manager_v1", 1)
[3171907.530] {mesa egl display queue} wl_registry#7.global(39, "xwayland_shell_v1", 1)
[3171907.534] {mesa egl display queue} wl_registry#7.global(40, "zwlr_screencopy_manager_v1", 3)
[3171907.537] {mesa egl display queue} wl_registry#7.global(41, "hyprland_toplevel_export_manager_v1", 2)
[3171907.541] {mesa egl display queue} wl_registry#7.global(42, "hyprland_global_shortcuts_manager_v1", 1)
[3171907.544] {mesa egl display queue} wl_registry#7.global(43, "xdg_dialog_v1", 1)
[3171907.548] {mesa egl display queue} wl_registry#7.global(44, "wp_drm_lease_device_v1", 1)
[3171907.552] {mesa egl display queue} wl_registry#7.global(45, "wp_linux_drm_syncobj_manager_v1", 1)
[3171907.556] {mesa egl display queue} wl_registry#7.global(46, "wl_drm", 2)
[3171907.559] {mesa egl display queue} wl_registry#7.global(47, "zwp_linux_dmabuf_v1", 5)
[3171907.563] {mesa egl display queue} -> wl_registry#7.bind(47, "zwp_linux_dmabuf_v1", 4, new id [unknown]#9)
[3171907.567] {mesa egl display queue} wl_registry#7.global(48, "wl_output", 4)
[3171907.570] {mesa egl display queue} wl_callback#8.done(9076)
[3171907.573] {mesa egl display queue} -> zwp_linux_dmabuf_v1#9.get_default_feedback(new id zwp_linux_dmabuf_feedback_v1#8)
[3171907.577] {mesa egl display queue} -> wl_display#1.sync(new id wl_callback#10)
[3171907.610] {Display Queue} wl_display#1.delete_id(10)
[3171907.613] {mesa egl display queue} zwp_linux_dmabuf_feedback_v1#8.format_table(fd 5, 800)
[3171907.622] {mesa egl display queue} zwp_linux_dmabuf_feedback_v1#8.main_device(array[8])
[3171908.083] {mesa egl display queue} zwp_linux_dmabuf_feedback_v1#8.tranche_target_device(array[8])
[3171908.087] {mesa egl display queue} zwp_linux_dmabuf_feedback_v1#8.tranche_flags(0)
[3171908.092] {mesa egl display queue} zwp_linux_dmabuf_feedback_v1#8.tranche_formats(array[100])
[3171908.099] {mesa egl display queue} zwp_linux_dmabuf_feedback_v1#8.tranche_done()
[3171908.102] {mesa egl display queue} zwp_linux_dmabuf_feedback_v1#8.done()
[3171908.114] {mesa egl display queue} wl_callback#10.done(9076)
[3171908.120] {mesa egl display queue} -> zwp_linux_dmabuf_feedback_v1#8.destroy()
[3171946.429] {Default Queue} -> wl_compositor#4.create_surface(new id wl_surface#10)
[1] 10491 segmentation fault WAYLAND_DEBUG=1 ./simple-egl