The first line looks up a backend implementation of the FileChooser portal based on the implementations registered in /usr/share/xdg-desktop-portal/portals, and picks xdg-desktop-portal-gtk.
The file_chooser_create method then tries to activate the selected D-Bus name:
This corresponds to the first log message, and indicates that starting xdg-desktop-portal-gtk timed out. It returns NULL, and export_portal_implementation() contains no checks for NULL as a second argument leading to the other messages. It ends with a g_return_val_if_fail() check causing g_dbus_interface_skeleton_export() to return FALSE without setting an error. We then get a segfault trying to dereference a NULL GError pointer.
So there's two issues to address:
1. xdg-desktop-portal-gtk startup is timing out in some instances.
2. xdg-desktop-portal is not handling this timeout error correctly.
I'll look at addressing (2) since it is the immediate cause of the crash reports, but portals are of limited use if they can't rely on any of the GUI helpers for things like file choosers.
So judging by the logs in some of the related error reports, we get the following log messages:
xdg- desktop- por[3113] : Failed to create file chooser proxy: Error calling StartServiceByName for org.freedesktop .impl.portal. desktop. gtk: Timeout was reached desktop- por[3113] : g_dbus_ interface_ skeleton_ set_flags: assertion 'G_IS_DBUS_ INTERFACE_ SKELETON (interface_)' failed desktop- por[3113] : invalid (NULL) pointer instance desktop- por[3113] : g_signal_ connect_ data: assertion 'G_TYPE_ CHECK_INSTANCE (instance)' failed desktop- por[3113] : g_dbus_ interface_ skeleton_ export: assertion 'G_IS_DBUS_ INTERFACE_ SKELETON (interface_)' failed
xdg-
xdg-
xdg-
xdg-
This centres around the following code, which is the first portal whose export depends on the presence of a UI implementation:
https:/ /github. com/flatpak/ xdg-desktop- portal/ blob/1. 0.2/src/ xdg-desktop- portal. c#L382- L385
implementation = find_portal_ implementation ("org.freedeskt op.impl. portal. FileChooser" ); portal_ implementation (connection,
file_chooser_ create (connection, implementation- >dbus_name) );
if (implementation != NULL)
export_
The first line looks up a backend implementation of the FileChooser portal based on the implementations registered in /usr/share/ xdg-desktop- portal/ portals, and picks xdg-desktop- portal- gtk.
The file_chooser_create method then tries to activate the selected D-Bus name:
https:/ /github. com/flatpak/ xdg-desktop- portal/ blob/1. 0.2/src/ file-chooser. c#L578- L589
This corresponds to the first log message, and indicates that starting xdg-desktop- portal- gtk timed out. It returns NULL, and export_ portal_ implementation( ) contains no checks for NULL as a second argument leading to the other messages. It ends with a g_return_ val_if_ fail() check causing g_dbus_ interface_ skeleton_ export( ) to return FALSE without setting an error. We then get a segfault trying to dereference a NULL GError pointer.
So there's two issues to address:
1. xdg-desktop- portal- gtk startup is timing out in some instances.
2. xdg-desktop-portal is not handling this timeout error correctly.
I'll look at addressing (2) since it is the immediate cause of the crash reports, but portals are of limited use if they can't rely on any of the GUI helpers for things like file choosers.