After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 787230 - Crash in libgdu
Crash in libgdu
Status: RESOLVED FIXED
Product: gnome-disk-utility
Classification: Core
Component: libgdu
3.25.x
Other Linux
: Normal critical
: ---
Assigned To: gnome-disk-utility-maint
gnome-disk-utility-maint
: 757976 788335 788553 788667 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-09-04 00:59 UTC by Kai Lüke
Modified: 2017-10-10 03:46 UTC
See Also:
GNOME target: 3.26
GNOME version: ---


Attachments
gdb full backtrace (12.27 KB, text/plain)
2017-09-04 00:59 UTC, Kai Lüke
  Details
Fix SIGSEGV in gdu_utils_get_all_contained_objects (2.55 KB, patch)
2017-09-04 01:04 UTC, Kai Lüke
committed Details | Review

Description Kai Lüke 2017-09-04 00:59:33 UTC
Created attachment 359049 [details]
gdb full backtrace

I don't know if this is the bug someone mentioned when trying to format a disk from nautilus and Disks crashed. Maybe this bug here has another origin. But since it's related to displaying the partition layout in the UI it seems at least relevant even if it's not reliably reproducible.
Comment 1 Kai Lüke 2017-09-04 01:04:43 UTC
Created attachment 359050 [details] [review]
Fix SIGSEGV in gdu_utils_get_all_contained_objects

Fix SIGSEGV in gdu_utils_get_all_contained_objects

The variable block_object was used as argument without
testing whether it is NULL.

The depending code after assignment is now guarded with
a if-block.
Comment 2 Ondrej Holy 2017-09-04 09:16:30 UTC
Review of attachment 359050 [details] [review]:

This is not probably anything common, but it might help in some corner cases...

::: src/libgdu/gduutils.c
@@ +1174,3 @@
     {
       block_object = (UDisksObject *) g_dbus_interface_dup_object (G_DBUS_INTERFACE (block));
+      if (block_object != NULL)

nitpick: I would rather add one small block and do not change the alignment of the whole if (partition_table != NULL) block, but it is up to you...

if (block != NULL)
  block_object = (UDisksObject *) g_dbus_interface_dup_object (G_DBUS_INTERFACE (block));

if (block_object != NULL)
  {
    objects_to_check = g_list_prepend (objects_to_check, g_object_ref (block_object));
    partition_table = udisks_object_get_partition_table (block_object);
  }

if (partition_table != NULL)
...
Comment 3 Kai Lüke 2017-09-04 10:16:36 UTC
André, should I include it in the .1 release or today?
Comment 4 Ondrej Holy 2017-09-04 15:32:53 UTC
Comment on attachment 359050 [details] [review]
Fix SIGSEGV in gdu_utils_get_all_contained_objects

Push it today, I did not realize that we are not yet in hard code freeze, thanks!
Comment 5 Kai Lüke 2017-09-05 05:20:03 UTC
Due to the time shift I already released without ;) It can go to the .1
Comment 6 Kai Lüke 2017-09-05 07:34:53 UTC
Found a good way to trigger it: Eject a USB drive which is then not powered of but still present as empty device. Unpluging the drive from the USB port when selected in Disks causes the crash.
Comment 7 Kai Lüke 2017-10-02 13:00:25 UTC
*** Bug 788335 has been marked as a duplicate of this bug. ***
Comment 8 Kai Lüke 2017-10-06 14:43:01 UTC
*** Bug 788553 has been marked as a duplicate of this bug. ***
Comment 9 Kai Lüke 2017-10-08 16:05:58 UTC
*** Bug 788667 has been marked as a duplicate of this bug. ***
Comment 10 Kai Lüke 2017-10-10 03:46:07 UTC
*** Bug 757976 has been marked as a duplicate of this bug. ***