Bug 92446 - gdu segfaults due to udisks_client_get_object returning null
Summary: gdu segfaults due to udisks_client_get_object returning null
Status: NEW
Alias: None
Product: udisks
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Martin Pitt
QA Contact:
Depends on:
Reported: 2015-10-13 09:17 UTC by Sebastien Bacher
Modified: 2016-10-04 19:04 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Note You need to log in before you can comment on or make changes to this bug.
Description Sebastien Bacher 2015-10-13 09:17:36 UTC
Reported on https://bugs.launchpad.net/ubuntu/+source/gnome-disk-utility/+bug/1479710 and https://retrace.fedoraproject.org/faf/reports/bthash/8281bb04e3d96be71f0533b318776dc95cc087b2

It seems to be easy to trigger by removing/adding partitions on an usb stick


"#1  0xb76a89b1 in udisks_object_peek_drive (object=0x0) at udisks-generated.c:31392
        ret = <optimized out>
#2  0x08064560 in gdu_window_select_object (window=0xa1061a8, object=0x0) at gduwindow.c:882
        ret = 168845736
        partition = 0xa06fb10
        table = 0x0
        drive = 0x0
#3  0x0806ed73 in create_partition_cb (source_object=0xa1061a8, res=0x0, user_data=0xa22c3f8) at gducreatepartitiondialog.c:374
        error = 0x0
        created_partition_object_path = 0xa393e90 "/org/freedesktop/UDisks2/block_devices/sdf1"
        partition_object = 0x0
        options_builder = {x = {3062377923, 3062363303, 3063296000, 167964752, 3062447638, 168661408, 0, 3062377865, 3062670108, 3062447607, 3063296000, 0, 3062378169, 167964752, 0, 167760240}}
        fstype = 0xa06e048 "\001"
#4  0xb6a40450 in g_task_return_now (task=task@entry=0xa02f658) at /build/glib2.0-Lm6jKr/glib2.0-2.45.7/./gio/gtask.c:1104
No locals.
#5  0xb6a40b3a in g_task_return (task=0xa02f658, type=<optimized out>) at /build/glib2.0-Lm6jKr/glib2.0-2.45.7/./gio/gtask.c:1162
        source = 0xb424e100
#6  0xb6a9dbf4 in reply_cb (connection=0xa028960, res=0xa02f880, user_data=0xa02f658) at /build/glib2.0-Lm6jKr/glib2.0-2.45.7/./gio/gdbusproxy.c:2579
        data = <optimized out>
        task = 0xa02f658
        value = 0xb4212fc0
        error = 0x0
        fd_list = 0x0
#7  0xb6a40450 in g_task_return_now (task=task@entry=0xa02f880) at /build/glib2.0-Lm6jKr/glib2.0-2.45.7/./gio/gtask.c:1104
No locals.
#8  0xb6a40b3a in g_task_return (task=0xa02f880, type=<optimized out>) at /build/glib2.0-Lm6jKr/glib2.0-2.45.7/./gio/gtask.c:1162
        source = 0xb424e100
#9  0xb6a92110 in g_dbus_connection_call_done (source=0xa028960, result=0xa02f808, user_data=0xa02f880) at /build/glib2.0-Lm6jKr/glib2.0-2.45.7/./gio/gdbusconnection.c:5704
        connection = 0xa028960
        task = 0xa02f880
        state = 0xa0e1500
        error = 0x0
        reply = 0xa2fc380
        value = <optimized out>
#10 0xb6a40450 in g_task_return_now (task=task@entry=0xa02f808) at /build/glib2.0-Lm6jKr/glib2.0-2.45.7/./gio/gtask.c:1104
No locals.
#11 0xb6a4049b in complete_in_idle_cb (task=0xa02f808) at /build/glib2.0-Lm6jKr/glib2.0-2.45.7/./gio/gtask.c:1118
No locals.""

Reported on https://bugzilla.gnome.org/show_bug.cgi?id=756275 where the maintainer added this comment

"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."

Doing some debugging with gdu create_partition_cb() in gducreatepartitiondialog.c

"udisks_client_settle (gdu_window_get_client (data->window));
partition_object = udisks_client_get_object (gdu_window_get_client (data->window), created_partition_object_path);
system("udisksctl dump > /tmp/log");
g_print("%x\n", (unsigned int)partition_object);"

When it segfaults the udiskctl dump knowns about sbd1 but the partition_object is null...
Comment 1 Richard B. Kreckel 2016-10-04 19:04:39 UTC
Any insight? I'm still getting this segfault with gnome-disk-utility 3.22 and udisks 2.1.7.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.