Failing to load GTK apps as another user under Wayland (failed to load cursor theme)
Steps to reproduce
- Create a new user on the system
- Create a new group, i.e. 'display' and at the new user to the group
- Locate the wayland socket and lockfile in the $XDG_RUNTIME_DIR for the user which hosts the Wayland session and chmod 770 and chmod 660 those files respectively and add 'display' as the group to these files (or whatever so the new user has proper access permission for these)
- Open a terminal emulator and su into the new user (it's important to either use su, which propagates environment variables, if you use sudo, you need to pass over XDG_RUNTIME_DIR and WAYLAND_DISPLAY).
- Try to open any app which uses GTK i.e. Firefox (with MOZ_ENABLE_WAYLAND=1), electron (with --ozone-platform-hint=wayland), xfce4-terminal
Additional information
- I experienced this in both Gnome and Sway and even tried it in a fresh Arch install with only Sway and Firefox and pretty much nothing else installed and the issue still occurred.
- Apps which don't use GTK do run
- The root user is an exception, apps can open as root without errors.
- I have checked that the icons in /usr/share/icons/Adwaita/cursors are accessible by the user
- Overriding cursor theme with XCURSOR_THEME= had no effect, it still tried to load Adwaita
- Installing icons locally and adding them to XCURSOR_PATH had no effect (locally both in the wayland host and sharing permissions + in the sub-user)
Version information
Arch Linux
gtk2 2.24.33-2
gtk3 1:3.24.35-2
gtk4 1:4.8.2-1
wayland 1.21.0-1
sway 1:1.7-10 (not specifically Sway related)
gnome-shell 1:43.1+r6+g92e9689a4-1 (not specifically Gnome related)
Warnings
[firefox@localhost]$ firefox
(firefox:629): Gdk-WARNING **: 07:33:40.987: Failed to load cursor theme Adwaita
(firefox:629): Gdk-WARNING **: 07:33:41.043: Failed to load cursor theme Adwaita
**
Gdk:ERROR:../gtk/gdk/wayland/gdkdisplay-wayland.c:1205:_gdk_wayland_display_get_cursor_theme: assertion failed: (display_wayland->cursor_theme_name)
Bail out! Gdk:ERROR:../gtk/gdk/wayland/gdkdisplay-wayland.c:1205:_gdk_wayland_display_get_cursor_theme: assertion failed: (display_wayland->cursor_theme_name)
Redirecting call to abort() to mozalloc_abort
ExceptionHandler::GenerateDump cloned child 679
ExceptionHandler::SendContinueSignalToChild sent continue signal to child
ExceptionHandler::WaitForContinueSignal waiting for continue signal...
(crashreporter:680): Gdk-WARNING **: 07:33:41.575: Failed to load cursor theme Adwaita
(crashreporter:680): Gdk-WARNING **: 07:33:41.605: Failed to load cursor theme Adwaita
**
Gdk:ERROR:../gtk/gdk/wayland/gdkdisplay-wayland.c:1205:_gdk_wayland_display_get_cursor_theme: assertion failed: (display_wayland->cursor_theme_name)
Bail out! Gdk:ERROR:../gtk/gdk/wayland/gdkdisplay-wayland.c:1205:_gdk_wayland_display_get_cursor_theme: assertion failed: (display_wayland->cursor_theme_name)
Backtrace
Nov 30 07:40:46 localhost audit[763]: ANOM_ABEND auid=1000 uid=1003 gid=1003 ses=1 pid=763 comm="crashreporter" exe="/usr/lib/firefox/crashreporter" sig=6 res=1
Nov 30 07:40:46 localhost kernel: audit: type=1701 audit(1669790446.859:102): auid=1000 uid=1003 gid=1003 ses=1 pid=763 comm="crashreporter" exe="/usr/lib/firefox/crashreporter" sig=6 res=1
Nov 30 07:40:46 localhost kernel: audit: type=1334 audit(1669790446.865:103): prog-id=23 op=LOAD
Nov 30 07:40:46 localhost kernel: audit: type=1334 audit(1669790446.865:104): prog-id=24 op=LOAD
Nov 30 07:40:46 localhost kernel: audit: type=1334 audit(1669790446.865:105): prog-id=25 op=LOAD
Nov 30 07:40:46 localhost audit: BPF prog-id=23 op=LOAD
Nov 30 07:40:46 localhost audit: BPF prog-id=24 op=LOAD
Nov 30 07:40:46 localhost audit: BPF prog-id=25 op=LOAD
Nov 30 07:40:46 localhost systemd[1]: Started Process Core Dump (PID 775/UID 0).
Nov 30 07:40:46 localhost audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@1-775-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Nov 30 07:40:46 localhost kernel: audit: type=1130 audit(1669790446.892:106): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@1-775-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Nov 30 07:40:47 localhost systemd-coredump[776]: Process 763 (crashreporter) of user 1003 dumped core.
Stack trace of thread 763:
#0 0x00007fa777ca164c n/a (libc.so.6 + 0x8864c)
#1 0x00007fa777c51958 raise (libc.so.6 + 0x38958)
#2 0x00007fa777c3b53d abort (libc.so.6 + 0x2253d)
#3 0x00007fa7789f206a n/a (libglib-2.0.so.0 + 0x1d06a)
#4 0x00007fa778a4dae0 g_assertion_message_expr (libglib-2.0.so.0 + 0x78ae0)
#5 0x00007fa777b78727 n/a (libgdk-3.so.0 + 0x59727)
#6 0x00007fa777b7964a n/a (libgdk-3.so.0 + 0x5a64a)
#7 0x00007fa777b7eed8 n/a (libgdk-3.so.0 + 0x5fed8)
#8 0x00007fa7783ca194 n/a (libgtk-3.so.0 + 0x1ca194)
#9 0x00007fa778b4611c g_signal_emit_valist (libgobject-2.0.so.0 + 0x3211c)
#10 0x00007fa778b46204 g_signal_emit (libgobject-2.0.so.0 + 0x32204)
#11 0x00007fa778533689 gtk_widget_realize (libgtk-3.so.0 + 0x333689)
#12 0x00007fa7785339f9 gtk_widget_map (libgtk-3.so.0 + 0x3339f9)
#13 0x00007fa7782b5c10 n/a (libgtk-3.so.0 + 0xb5c10)
#14 0x00007fa778305245 n/a (libgtk-3.so.0 + 0x105245)
#15 0x00007fa778b45331 g_signal_emit_valist (libgobject-2.0.so.0 + 0x31331)
#16 0x00007fa778b46204 g_signal_emit (libgobject-2.0.so.0 + 0x32204)
#17 0x00007fa77853399b gtk_widget_map (libgtk-3.so.0 + 0x33399b)
#18 0x00007fa77854e829 n/a (libgtk-3.so.0 + 0x34e829)
#19 0x00007fa778b4611c g_signal_emit_valist (libgobject-2.0.so.0 + 0x3211c)
#20 0x00007fa778b46204 g_signal_emit (libgobject-2.0.so.0 + 0x32204)
#21 0x00007fa77853399b gtk_widget_map (libgtk-3.so.0 + 0x33399b)
#22 0x00007fa778552a0e n/a (libgtk-3.so.0 + 0x352a0e)
#23 0x00007fa778b28210 g_closure_invoke (libgobject-2.0.so.0 + 0x14210)
#24 0x00007fa778b55b47 n/a (libgobject-2.0.so.0 + 0x41b47)
#25 0x00007fa778b45f75 g_signal_emit_valist (libgobject-2.0.so.0 + 0x31f75)
#26 0x00007fa778b46204 g_signal_emit (libgobject-2.0.so.0 + 0x32204)
#27 0x00007fa7785343d7 gtk_widget_show (libgtk-3.so.0 + 0x3343d7)
#28 0x000055e5c1c724ca n/a (crashreporter + 0x1f4ca)
#29 0x00007fa777c3c290 n/a (libc.so.6 + 0x23290)
#30 0x00007fa777c3c34a __libc_start_main (libc.so.6 + 0x2334a)
#31 0x000055e5c1c69715 n/a (crashreporter + 0x16715)
Stack trace of thread 765:
#0 0x00007fa777d140bf __poll (libc.so.6 + 0xfb0bf)
#1 0x00007fa778a811df n/a (libglib-2.0.so.0 + 0xac1df)
#2 0x00007fa778a29132 g_main_context_iteration (libglib-2.0.so.0 + 0x54132)
#3 0x00007fa778a29182 n/a (libglib-2.0.so.0 + 0x54182)
#4 0x00007fa778a57e05 n/a (libglib-2.0.so.0 + 0x82e05)
#5 0x00007fa777c9f8fd n/a (libc.so.6 + 0x868fd)
#6 0x00007fa777d21a60 n/a (libc.so.6 + 0x108a60)
Stack trace of thread 766:
#0 0x00007fa777d197fd syscall (libc.so.6 + 0x1007fd)
#1 0x00007fa778a7aad7 g_cond_wait_until (libglib-2.0.so.0 + 0xa5ad7)
#2 0x00007fa7789f8893 n/a (libglib-2.0.so.0 + 0x23893)
#3 0x00007fa778a5d6cb n/a (libglib-2.0.so.0 + 0x886cb)
#4 0x00007fa778a57e05 n/a (libglib-2.0.so.0 + 0x82e05)
#5 0x00007fa777c9f8fd n/a (libc.so.6 + 0x868fd)
#6 0x00007fa777d21a60 n/a (libc.so.6 + 0x108a60)
Stack trace of thread 768:
#0 0x00007fa777d140bf __poll (libc.so.6 + 0xfb0bf)
#1 0x00007fa778a811df n/a (libglib-2.0.so.0 + 0xac1df)
#2 0x00007fa778a29132 g_main_context_iteration (libglib-2.0.so.0 + 0x54132)
#3 0x00007fa775fecfde n/a (libdconfsettings.so + 0x5fde)
#4 0x00007fa778a57e05 n/a (libglib-2.0.so.0 + 0x82e05)
#5 0x00007fa777c9f8fd n/a (libc.so.6 + 0x868fd)
#6 0x00007fa777d21a60 n/a (libc.so.6 + 0x108a60)
Stack trace of thread 767:
#0 0x00007fa777d140bf __poll (libc.so.6 + 0xfb0bf)
#1 0x00007fa778a811df n/a (libglib-2.0.so.0 + 0xac1df)
#2 0x00007fa778a29ddf g_main_loop_run (libglib-2.0.so.0 + 0x54ddf)
#3 0x00007fa777a5b33c n/a (libgio-2.0.so.0 + 0x10a33c)
#4 0x00007fa778a57e05 n/a (libglib-2.0.so.0 + 0x82e05)
#5 0x00007fa777c9f8fd n/a (libc.so.6 + 0x868fd)
#6 0x00007fa777d21a60 n/a (libc.so.6 + 0x108a60)
ELF object binary architecture: AMD x86-64
Nov 30 07:40:47 localhost kernel: audit: type=1131 audit(1669790447.135:107): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@1-775-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Nov 30 07:40:47 localhost audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@1-775-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Nov 30 07:40:47 localhost systemd[1]: systemd-coredump@1-775-0.service: Deactivated successfully.