GNOME Bugzilla – Bug 756275
segfault in g_dbus_object_get_interface
Last modified: 2017-11-13 14:42:23 UTC
Those segfault seem to have started with gdu 3.16 stacktrace "#0 0xb6aa9e73 in g_dbus_object_get_interface (object=0x0, interface_name=0xb76b07e7 "org.freedesktop.UDisks2.Drive") at /build/glib2.0-Lm6jKr/glib2.0-2.45.7/./gio/gdbusobject.c:149 iface = <optimized out> __func__ = "g_dbus_object_get_interface"
+ Trace 235559
Reported on https://bugs.launchpad.net/ubuntu/+source/gnome-disk-utility/+bug/1479710 and https://retrace.fedoraproject.org/faf/reports/bthash/8281bb04e3d96be71f0533b318776dc95cc087b2 The rh bugzilla description state the user was creating an ext4 partition and an usb stick
in fact older versions seem to have similar issues, the stacktrace is just slightly different and didn't match in the same error bucket on the errors.ubuntu.com reports
The issue is quite easy to trigger by formatting an usb key and trying to add a partition directly after that, it segfault like a third of the tries
Thanks for moving this upstream. This doesn't look like an easy fix. We can return early in create_partition_cb if udisks_client_get_object returns NULL, but it's probably better to crash because the partition is not going to be formatted then. We need to figure out why udisks_client_get_object sometimes returns NULL. There is probably a race, either in udisks or possibly g-d-u itself.
Reported against udisks with some extra debug info https://bugs.freedesktop.org/show_bug.cgi?id=92446
*** Bug 756703 has been marked as a duplicate of this bug. ***
The solution is that UDisks needs to ensure that the object is there when returning from udisks_partition_table_call_create_partition. There is a correct waiter now in UDisks and if this ever happens again then the udisks_linux_block_object_trigger_uevent is guilty, it's located at the end of udisks_partition_table_call_create_partition (it might result in the object to disappear shortly - writing a waiter again will be hard because there is nothing which distinguishes the old from the new).
UDisks 2.7.1 doesn't have the uevent call at the end, so I don't expect this problem to be there. But 2.7.2 adds this uevent and it would be good to know if this still happens.
I just used gnome-disk-utility 3.22.1-1 and udisks2 2.7.2-2 on Debian buster to format a USB stick to FAT format a few times without getting any crashes. IIRC that was the procedure that was causing crashes before.