omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

xdg-desktop-portal-gtk crashes with SIGSEGV during portal/file chooser operation

Open AnoopLamba opened this issue 3 months ago • 3 comments

On Omarchy 4.0.1-1, xdg-desktop-portal-gtk crashed with SIGSEGV while handling a portal/file chooser operation.

What systemd-coredump recorded:

  • Process: xdg-desktop-portal-gtk
  • PID: 1358
  • Binary: /usr/lib/xdg-desktop-portal-gtk
  • Signal: SIGSEGV
  • Time: Thu 2026-08-27 12:29:29 IST

Direct journal/systemd errors:

kernel: pool-22[260019]: segfault at 7fafdc3b0780 ip 00007fafe35789ef sp 00007fafbb3f8218 error 4 in libc.so.6
systemd-coredump: Process 1358 (xdg-desktop-por) of user 1000 dumped core.
systemd[849]: xdg-desktop-portal-gtk.service: Main process exited, code=dumped, status=11/SEGV
systemd[849]: xdg-desktop-portal-gtk.service: Failed with result 'core-dump'.
/usr/lib/xdg-desktop-portal[1244]: Backend call failed: Remote peer disconnected

Relevant package versions:

xdg-desktop-portal-gtk 1.15.3-1
xdg-desktop-portal 1.22.1-2
gtk3 1:3.24.52-1
glib2 2.88.3-1
glibc 2.44+r24+g16be1518495f-1
glycin 2.1.5-2
dconf 0.49.0-1

Symbolized crashing stack points into GLib/GIO MIME/content-type detection:

#0  __strcmp_avx2 ()
#1  cache_alias_lookup(alias=0x7fafdc3b0780 <Cannot access memory>)
#2  __gio_xdg_cache_unalias_mime_type(mime=0x7fafdc3b0780 <Cannot access memory>)
#3  __gio_xdg_cache_mime_type_subclass(...)
#4  __gio_xdg_mime_type_subclass(...)
#5  g_content_type_guess_impl(filename="smart-buy-handoff-issue-12-2026-08-27.md", ...)
#6  g_content_type_guess(...)
#7  get_content_type(...)
#8  _g_local_file_info_get(... path="/tmp/smart-buy-handoff-issue-12-2026-08-27.md" ...)
#9  g_local_file_query_info(...)
#10 query_info_async_thread(...)
#11 g_task_thread_pool_thread(...)

The main GTK thread was rendering a file chooser/tree view at the same time:

g_content_type_get_generic_icon_name(type="text/markdown")
get_category_from_content_type()
gtkfilechooserwidget.c
gtktreeview.c

Resource exhaustion does not appear to be the cause: memory was available and there were no OOM-killer messages around the crash.

omarchy debug --no-sudo --print was attempted but this Omarchy install returned:

Unknown Omarchy command: omarchy debug --no-sudo --print
Run 'omarchy commands --all' to discover available commands.

This may ultimately be an upstream GTK/GLib/GIO issue, but reporting here because it happened in the Omarchy desktop session and directly affected the portal backend used by desktop apps.

Filed by gpt-5.5 via pi.

AnoopLamba avatar Aug 27 '26 07:08 AnoopLamba

I can reproduce an xdg-desktop-portal-gtk SIGSEGV on Omarchy 4.0.2 when Brave invokes a native file portal under Hyprland/Wayland.

Environment

Omarchy: 4.0.2-1
Kernel: 7.1.9-arch1-2
Hyprland: 0.56.2
xdg-desktop-portal-gtk: 1.15.3-1
xdg-desktop-portal-hyprland: 1.4.1-1
Browser: brave-origin-bin 1:1.94.121-1
Hardware: Dell G15 5530, hybrid Intel iGPU + NVIDIA RTX 3050

The journal reports:

xdg-desktop-portal-gtk[1720]: ../gtk/gdk/gdkwindow.c:1451 Subsurface windows can only be used on Wayland
xdg-desktop-portal-gtk[1720]: gtk_widget_register_window: assertion 'GDK_IS_WINDOW (window)' failed

systemd-coredump[254044]: Process 1720 (xdg-desktop-por) dumped core.

#0  gdk_window_set_transient_for (libgdk-3.so.0 + 0x44474)
#1  (libgtk-3.so.0 + 0x386906)
#4  gtk_popover_set_relative_to (libgtk-3.so.0 + 0x252a5d)
#25 (xdg-desktop-portal-gtk + 0xb275)

systemd[1111]: xdg-desktop-portal-gtk.service:
Main process exited, code=dumped, status=11/SEGV

/usr/lib/xdg-desktop-portal[1605]:
Backend call failed: Remote peer disconnected

The crash is triggered when Brave requests a native file chooser through the portal under the Hyprland Wayland session.

I can provide the complete:

coredumpctl info xdg-desktop-portal-gtk
journalctl --user -b -u xdg-desktop-portal-gtk
journalctl --user -b -u xdg-desktop-portal

output if useful.

Jitheswar avatar Sep 05 '26 19:09 Jitheswar

Same crash, confirmed on a second machine — plus a second, distinct crash site in the same backend that has no GTK warning before it.

1. Same signature as reported (corroboration)

journalctl -b 2bfbe078… at 2026-09-21 12:16:38 (pid 2452) shows the identical two lines from the original report, followed by the segfault:

xdg-desktop-portal-gtk[2452]: ../gtk/gdk/gdkwindow.c:1451 Subsurface windows can only be used on Wayland
xdg-desktop-portal-gtk[2452]: gtk_widget_register_window: assertion 'GDK_IS_WINDOW (window)' failed
systemd-coredump[937438]: Process 2452 (xdg-desktop-por) of user 1000 dumped core.

and the coredump matches frame-for-frame, including the same portal offset:

frame original report this machine
#0 gdk_window_set_transient_for (libgdk-3.so.0 + 0x44474) gdk_window_set_transient_for (libgdk-3.so.0 + 0x44474)
portal frame xdg-desktop-portal-gtk + 0xb275 xdg-desktop-portal-gtk + 0xb275

Same xdg-desktop-portal-gtk 1.15.3-1. Different hardware: Intel Raptor Lake-P iGPU + NVIDIA RTX 5060 Max-Q (report has Intel + RTX 3050). Omarchy 4.0.4-1, Hyprland 0.56.2-2, gtk3 3.24.52-1, kernel 7.2.5-3-omarchy.

2. A second crash site: silent NULL deref in GTK3's X11 XI2 input path

3 more crashes, 3 different boots, with no Subsurface windows warning beforehand — they just SEGV:

date pid frame #0
2026-09-25 01:08:38 2283 0x0000000000000000 (call through NULL)
2026-09-25 19:48:23 2573 0x0000000000000000
2026-09-26 00:45:47 2501 0x0000000000000000

Fully symbolized (debuginfod + gdb, pid 2501):

#0  0x0000000000000000 in ?? ()
#1  g_hash_table_lookup_node (hash_table=0x5ecfcf59f500, key=0x9c) at ../glib/glib/ghash.c:430
#2  g_hash_table_lookup (hash_table=0x5ecfcf59f500, key=0x9c) at ../glib/glib/ghash.c:1496
#3  lookup_cached_xatom (display=0x5ecfcf57edd0 [GdkWaylandDisplay], atom=0x9c) at ../gtk/gdk/x11/gdkproperty-x11.c:76
#4  lookup_cached_xatom (display=0x5ecfcf57edd0 [GdkWaylandDisplay], atom=0x9c) at ../gtk/gdk/x11/gdkproperty-x11.c:67
#5  gdk_x11_atom_to_xatom_for_display (display=0x5ecfcf57edd0 [GdkWaylandDisplay], atom=0x9c) at ../gtk/gdk/x11/gdkproperty-x11.c:109
#6  handle_property_change (device_manager=<optimized out>, ev=0x7cde000159c0) at ../gtk/gdk/x11/gdkdevicemanager-xi2.c:1109
#7  gdk_x11_device_manager_xi2_translate_event (translator=<optimized out>, display=0x5ecfcf697d50 [GdkX11Display], xevent=0x7ffcf909fdb0) at ../gtk/gdk/x11/gdkdevicemanager-xi2.c:1559
#8  gdk_x11_device_manager_xi2_translate_event (translator=<optimized out>, display=0x5ecfcf697d50 [GdkX11Display], xevent=0x7ffcf909fdb0) at ../gtk/gdk/x11/gdkdevicemanager-xi2.c:1499
#9  _gdk_x11_event_translator_translate (translator=0x5ecfcf624810, display=0x5ecfcf697d50 [GdkX11Display], xevent=xevent@entry=0x7ffcf909fdb0) at ../gtk/gdk/x11/gdkeventtranslator.c:51
#10 gdk_event_source_translate_event (event_source=0x5ecfcf614670, xevent=0x7ffcf909fdb0) at ../gtk/gdk/x11/gdkeventsource.c:243
#11 _gdk_x11_display_queue_events (display=0x5ecfcf697d50 [GdkX11Display]) at ../gtk/gdk/x11/gdkeventsource.c:341
#12 gdk_display_get_event (display=0x5ecfcf697d50 [GdkX11Display]) at ../gtk/gdk/gdkdisplay.c:442
#13 gdk_event_source_dispatch.lto_priv () at ../gtk/gdk/x11/gdkeventsource.c:354
#14 g_main_dispatch (context=0x5ecfcf58af50) at ../glib/glib/gmain.c:3591
#15 g_main_context_dispatch_unlocked (context=0x5ecfcf58af50) at ../glib/glib/gmain.c:4451
#16 g_main_context_iterate_unlocked (context=0x5ecfcf58af50, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4516
#17 g_main_loop_run (loop=0x5ecfcf574210) at ../glib/glib/gmain.c:4721
#18 main (argc=<optimized out>, argv=<optimized out>) at ../xdg-desktop-portal-gtk/src/xdg-desktop-portal-gtk.c:290

Stated carefully:

  • Observed: a call through a NULL function pointer from inside g_hash_table_lookup_node, on a hash table gdb could not fully read. The frames above it are entirely GTK3 X11 code servicing an XI2 device property-change event — a different trigger than the file-chooser/popover path above.
  • Observed: the display pointer reaching gdk_x11_atom_to_xatom_for_display (frames #3–#5, 0x5ecfcf57edd0) is a different object from the GdkX11Display in frames #7–#13 (0x5ecfcf697d50), and gdb types it as GdkWaylandDisplay.
  • Inference, not proven: GTK3's X11 atom-cache is being reached with a non-X11 display, so it computes a bogus cache pointer and the lookup dereferences it. I could not confirm the exact field arithmetic without GTK3 3.24.52 source in front of me.
  • Ruled out: this is not GDK_BACKEND forcing X11. default/hypr/envs.lua:12 sets GDK_BACKEND=wayland,x11,*; I verified empirically that a GTK3 app under that exact value opens Wayland (0 X11 sockets, 1 Wayland socket), same as GDK_BACKEND=wayland. The X11 frames come from GTK3's own XWayland interop, not the session forcing X11.

Impact

xdg-desktop-portal-gtk.service dies, the portal daemon logs Backend call failed: Remote peer disconnected, and system dialogs (file chooser, screen share, permission prompts) are unavailable until something restarts the unit. All 4 crashes here were in the same condition as the original: gtk3 3.24.52-1 on a Hyprland Wayland session.

Filed by Space Bunny Free via OpenCode.

taurovvn avatar Sep 27 '26 06:09 taurovvn

Another hit of the second crash site (NULL call via XI2 handle_property_change) described in the comment above, with a trigger and the atom name, which the thread doesn't have yet.

Trigger: input devices disconnecting. I switched a KVM, which removed its USB hub with a keyboard and a mouse receiver. The kernel logged the disconnect in the same second as the segfault:

Oct 11 14:53:37 kernel: usb 1-5.3: USB disconnect, device number 35
Oct 11 14:53:37 kernel: usb 1-5.3.3: USB disconnect, device number 36
Oct 11 14:53:37 kernel: usb 1-5.3.4: USB disconnect, device number 37
Oct 11 14:53:37 kernel: xdg-desktop-por[2258]: segfault at 0 ip 0000000000000000 sp 00007ffe1cb79048 error 14

It is not deterministic: the same hub disconnected 10 other times in this session without a crash. The portal had been running for 16h25m.

Stack (crashing thread):

#0  0x0000000000000000
#1  g_hash_table_lookup                  (libglib-2.0.so.0 + 0x4a9cc)
#2  gdk_x11_atom_to_xatom_for_display    (libgdk-3.so.0 + 0x8cde9)
#3  n/a                                  (libgdk-3.so.0 + 0x7b298)
#4  n/a                                  (libgdk-3.so.0 + 0x82d3a)
#5  n/a                                  (libgdk-3.so.0 + 0x85d6e)
#6  gdk_display_get_event                (libgdk-3.so.0 + 0x2429b)
...
#11 main  xdg-desktop-portal-gtk.c:290

Atom name. The instruction before frame #3's return address (libgdk-3.so.0 + 0x7b292) is call gdk_x11_get_xatom_by_name with the argument string "Wacom Serial IDs". That is the non-_for_display variant, which resolves against GDK's default display. The process environment in the core has WAYLAND_DISPLAY=wayland-1 and GDK_BACKEND=wayland,x11,*, so the default display should be the Wayland one. That fits the earlier inference that a Wayland display reaches the X11 atom cache, though I could not inspect the display object itself (no gtk3 debug symbols).

Not established: why it only happens sometimes. My guess is that it needs the portal to have opened its secondary X11 display for an Xwayland client's dialog first, but I have no evidence for that.

Versions: Omarchy 4.0.4-1, xdg-desktop-portal-gtk 1.15.3-1, gtk3 1:3.24.52-1, glib2 2.88.3-1, xorg-xwayland 24.1.13-1, hyprland 0.56.2-2, kernel 7.2.5-3-omarchy.

Same signature elsewhere, which suggests this is a GTK3 bug rather than anything Omarchy-specific:

  • Ubuntu, xdg-desktop-portal-gtk on Wayland, open since 2021: https://bugs.launchpad.net/ubuntu/+source/xdg-desktop-portal-gtk/+bug/1954347
  • openSUSE, ibus-ui-gtk3, symbolized to handle_property_change at gdkdevicemanager-xi2.c:1109: https://forums.opensuse.org/t/ibus-ui-gtk3-crash-due-to-gtk3-bug/192696
  • GNOME/gtk #7749, same signature from a different entry point (GtkMountOperation): https://gitlab.gnome.org/GNOME/gtk/-/issues/7749

Filed by Claude Opus 5.5 via Claude Code.

WilliamForsdal avatar Oct 11 '26 13:10 WilliamForsdal