iridescent-desktop / hopalong

Simple Wayland compositor based on wlroots
Other
17 stars 4 forks source link

Segfault when switching vt, opening window, then switching back #7

Open adlocode opened 2 years ago

adlocode commented 2 years ago

When I run Hopalong using the DRM backend on one VT, switch VT, open a terminal and start a program to open a window on Hopalong, then switch back to Hopalong's VT, Hopalong segfaults.

Steps to reproduce: Run Hopalong on tty3 (wayland-1) Switch to main desktop on tty2 (wayland-0) Run WAYLAND_DISPLAY=wayland-1 weston-terminal Switch back to tty3 Hopalong segfaults

I haven't got the full backtrace but gdb's top line is:

Thread 1 "hopalong" received signal SIGSEGV, Segmentation fault.
0x0000000000409956 in hopalong_view_focus (view=0x1711830, surface=0x175c930) at ../src/compositor/hopalong-view.c:365
365         wlr_seat_keyboard_notify_enter(seat, surface,

Here is the full backtrace:

Thread 1 "hopalong" received signal SIGSEGV, Segmentation fault.
0x0000000000409956 in hopalong_view_focus (view=0x1594d50, surface=0x15ce250) at ../src/compositor/hopalong-view.c:365
365         wlr_seat_keyboard_notify_enter(seat, surface,
#0  0x0000000000409956 in hopalong_view_focus (view=0x1594d50, surface=0x15ce250) at ../src/compositor/hopalong-view.c:365
#1  0x000000000040694a in hopalong_xdg_surface_map (listener=0x1594da0, data=0x16d6940) at ../src/compositor/hopalong-xdg.c:26
#2  0x00007ffff7bed3cc in wlr_signal_emit_safe () at /lib64/libwlroots.so.10
#3  0x00007ffff7be8286 in surface_commit_state () at /lib64/libwlroots.so.10
#4  0x00007ffff7af6746 in ffi_call_unix64 () at /lib64/libffi.so.8
#5  0x00007ffff7af34d2 in ffi_call_int.lto_priv () at /lib64/libffi.so.8
#6  0x00007ffff7f906c8 in wl_closure_invoke.constprop () at /lib64/libwayland-server.so.0
#7  0x00007ffff7f94904 in wl_client_connection_data () at /lib64/libwayland-server.so.0
#8  0x00007ffff7f933a2 in wl_event_loop_dispatch () at /lib64/libwayland-server.so.0
#9  0x00007ffff7f93b05 in wl_display_run () at /lib64/libwayland-server.so.0
#10 0x0000000000405250 in hopalong_server_run (server=0x423470) at ../src/compositor/hopalong-server.c:172
#11 0x000000000040cfd9 in main (argc=1, argv=0x7fffffffdfd8, envp=0x7fffffffdfe8) at ../src/compositor/hopalong-main.c:153
adlocode commented 2 years ago

Removing the call to wlr_seat_keyboard_notify_enter () does fix the segfault, but obviously this means the compositor no longer works properly.