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 780407 - Masking upower.service makes mutter crash
Masking upower.service makes mutter crash
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2017-03-22 16:00 UTC by Bastien Nocera
Modified: 2017-05-31 14:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
monitor-manager: Fix crash when UPower is not available (892 bytes, patch)
2017-05-31 13:17 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2017-03-22 16:00:42 UTC
mutter-3.23.92-1.fc26.x86_64

Process 983 (gnome-shell) of user 42 dumped core.

Stack trace of thread 983:
#0  0x00007f3a8ee4a6b9 up_exported_daemon_get_lid_is_closed (libupower-glib.so.3)
#1  0x00007f3a9ab88a75 meta_monitor_config_new (libmutter-0.so.0)
#2  0x00007f3a9ab8e721 meta_monitor_manager_constructed (libmutter-0.so.0)
#3  0x00007f3a96469a00 g_object_new_internal (libgobject-2.0.so.0)
#4  0x00007f3a9646b2b5 g_object_newv (libgobject-2.0.so.0)
#5  0x00007f3a9646ba74 g_object_new (libgobject-2.0.so.0)
#6  0x00007f3a9ab7f5bb meta_backend_real_post_init (libmutter-0.so.0)
#7  0x00007f3a9ac07c9f meta_backend_native_post_init (libmutter-0.so.0)
#8  0x00007f3a9abbd326 meta_init (libmutter-0.so.0)
#9  0x000055b0b992c1aa main (gnome-shell)
#10 0x00007f3a945c85fe __libc_start_main (libc.so.6)
#11 0x000055b0b992c5ba _start (gnome-shell)

Something like this should fix it:
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index e03b5cb6f..b2fd646a0 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -260,6 +260,9 @@ lid_is_closed_changed (UpClient   *client,
 static gboolean
 meta_monitor_manager_real_is_lid_closed (MetaMonitorManager *manager)
 {
+  if (!manager->up_client)
+    return FALSE;
+
   return up_client_get_lid_is_closed (manager->up_client);
 }
Comment 1 Bastien Nocera 2017-05-31 13:17:41 UTC
Created attachment 352952 [details] [review]
monitor-manager: Fix crash when UPower is not available

Don't access the upower client if it doesn't exist
Comment 2 Jonas Ådahl 2017-05-31 13:24:23 UTC
Review of attachment 352952 [details] [review]:

lgtm.
Comment 3 Bastien Nocera 2017-05-31 14:13:08 UTC
Attachment 352952 [details] pushed as f5f0ff0 - monitor-manager: Fix crash when UPower is not available