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 771875 - display: Fix possible crash on startup
display: Fix possible crash on startup
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Display
unspecified
Other All
: Normal normal
: ---
Assigned To: Debarshi Ray
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-09-23 11:40 UTC by Bastien Nocera
Modified: 2016-09-24 00:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
display: Fix possible crash on startup (2.15 KB, patch)
2016-09-23 11:41 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2016-09-23 11:40:56 UTC
.
Comment 1 Bastien Nocera 2016-09-23 11:41:01 UTC
Created attachment 336155 [details] [review]
display: Fix possible crash on startup

If no items are added to the GVariantBuilder, g_variant_builder_close()
would throw a critical, g_variant_builder_end() would throw a
segmentation fault.

As this can only happen when there are no items added to the output_ids
hashtable, this should only happen if there are no displays known to
libgnome-desktop (and therefore mutter).

See https://bugzilla.redhat.com/show_bug.cgi?id=1280075
Comment 2 Rui Matos 2016-09-23 11:49:00 UTC
Review of attachment 336155 [details] [review]:

If I'm reading the gvariant docs correctly, I think replacing G_VARIANT_TYPE_ARRAY which is an indefinite type with the actual array type "a{uv}" would allows us to create an empty array.

But logically, this looks good, since there's no point in even calling the dbus api if we have no output infos.
Comment 3 Bastien Nocera 2016-09-24 00:47:05 UTC
Attachment 336155 [details] pushed as 8da6fa2 - display: Fix possible crash on startup