cinnamon-settings power applet crashes

Created on 25 Jun 2016  路  17Comments  路  Source: linuxmint/cinnamon

Since upgrading to cinnamon 3.0, when I try to open the power applet in cinnamon-settings, cinnamon-settings segfaults and disappears. My system appears to be running systemd (multiple users, started by /sbin/init from debian systemd-sysv package).

Here's a backtrace of it:

(gdb) run /usr/bin/cinnamon-settings power
Starting program: /usr/bin/python /usr/bin/cinnamon-settings power
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 31986 is executing new program: /usr/bin/env
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 31986 is executing new program: /usr/bin/python2.7
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffeabbb700 (LWP 32007)]
[New Thread 0x7fffea3ba700 (LWP 32008)]
[New Thread 0x7fffe1dc8700 (LWP 32009)]
[New Thread 0x7fffe13ba700 (LWP 32010)]
Loading Power module

Thread 1 "python2" received signal SIGSEGV, Segmentation fault.
0x00007fffcfde40d5 in up_client_get_lid_is_present () from /usr/lib/x86_64-linux-gnu/libupower-glib.so.3
(gdb) bt
#0  0x00007fffcfde40d5 in up_client_get_lid_is_present () at /usr/lib/x86_64-linux-gnu/libupower-glib.so.3
#1  0x00007ffff5dc7060 in ffi_call_unix64 () at /usr/lib/x86_64-linux-gnu/libffi.so.6
#2  0x00007ffff5dc6acb in ffi_call () at /usr/lib/x86_64-linux-gnu/libffi.so.6
#3  0x00007ffff698f6fc in  () at /usr/lib/python2.7/dist-packages/gi/_gi.x86_64-linux-gnu.so
#4  0x00007ffff69911e8 in  () at /usr/lib/python2.7/dist-packages/gi/_gi.x86_64-linux-gnu.so
#5  0x00007ffff6985355 in  () at /usr/lib/python2.7/dist-packages/gi/_gi.x86_64-linux-gnu.so
#6  0x00000000004b0cf3 in PyObject_Call ()
#7  0x00000000004c9a2a in PyEval_EvalFrameEx ()
#8  0x00000000004c97ff in PyEval_EvalFrameEx ()
#9  0x00000000004c2285 in PyEval_EvalCodeEx ()
#10 0x00000000004ca2e5 in PyEval_EvalFrameEx ()
#11 0x00000000004c97ff in PyEval_EvalFrameEx ()
#12 0x00000000004c2285 in PyEval_EvalCodeEx ()
#13 0x00000000004de4fe in  ()
#14 0x00000000004b0cf3 in PyObject_Call ()
#15 0x00000000004f45ae in  ()
#16 0x00000000004b0cf3 in PyObject_Call ()
#17 0x00000000004cdda0 in PyEval_CallObjectWithKeywords ()
#18 0x00000000004e14c4 in PyInstance_New ()
#19 0x00000000004b0cf3 in PyObject_Call ()
#20 0x00000000004c9a2a in PyEval_EvalFrameEx ()
#21 0x00000000004c2285 in PyEval_EvalCodeEx ()
#22 0x00000000004c2029 in PyEval_EvalCode ()
#23 0x00000000004f1a1f in  ()
#24 0x00000000004ec382 in PyRun_FileExFlags ()
#25 0x00000000004eab61 in PyRun_SimpleFileExFlags ()
#26 0x000000000049dfc8 in Py_Main ()
#27 0x00007ffff6d125f0 in __libc_start_main (main=
    0x49d8f0 <main>, argc=3, argv=0x7fffffffdf18, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdf08) at libc-start.c:291
#28 0x000000000049d819 in _start ()

Most helpful comment

@itzexor (exor on IRC) pointed me to a debian bug reporting this issue, where a fix is presented. This fix seems to work for me. Here's an overly complicated patch for the simple fix:

--- /usr/share/cinnamon/cinnamon-settings/modules/cs_power.py.old   2016-07-10 20:37:31.444503859 -0400
+++ /usr/share/cinnamon/cinnamon-settings/modules/cs_power.py   2016-07-10 20:35:27.224499125 -0400
@@ -98,7 +98,7 @@
             return
         print "Loading Power module"

-        self.up_client = UPowerGlib.Client()
+        self.up_client = UPowerGlib.Client.new()

         self.csd_power_proxy = Gio.DBusProxy.new_sync(
                 Gio.bus_get_sync(Gio.BusType.SESSION, None),

All 17 comments

I've tried with both sysvinit and systemd, and several recent kernels as they've been pushed to sid. I'm pasting the output of strace.

It looks like your issue is upower related not cinnamon.

  1. What aspect of it makes that clear?
  2. Would it be possible for some code to be added to catch this particular problem and have cinnamon-settings report it to the user?
  3. Is there any way to know what sort of problem it is? Is it a misconfiguration of upowerd, a bug in upowerd, some sort of incompatibility with my system, a newer version that's not playing nicely with cinnamon, or something else?
  • There is no mention of any cinnamon code in the backtrace
Thread 1 "python2" received signal SIGSEGV, Segmentation fault.
0x00007fffcfde40d5 in up_client_get_lid_is_present () from /usr/lib/x86_64-linux-gnu/libupower-glib.so.3
(gdb) bt
#0  0x00007fffcfde40d5 in up_client_get_lid_is_present () at /usr/lib/x86_64-linux-gnu/libupower-glib.so.3

  • I don't know
  • I doubt Debian has a newer upower version issue as it works fine here
$ upower -v
UPower client version 0.99.4
UPower daemon version 0.99.4

running the command below and posting the output might give a clue

upower -d

I get

$ upower -d
Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         no
  updated:              Mon 27 Jun 2016 17:56:05 BST (991 seconds ago)
  has history:          no
  has statistics:       no
  unknown
    warning-level:       none
    icon-name:          ''

Daemon:
  daemon-version:  0.99.4
  on-battery:      no
  lid-is-closed:   no
  lid-is-present:  no
  critical-action: HybridSleep

My system reports exactly the same version. Here's the output of upower -d:

$ upower -d
Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path:          AC
  power supply:         yes
  updated:              Mon 27 Jun 2016 03:43:38 AM EDT (35032 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              yes
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               SMP
  model:                DELL KWFFN33
  serial:               531
  power supply:         yes
  updated:              Mon 27 Jun 2016 01:25:38 PM EDT (112 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               fully-charged
    warning-level:       none
    energy:              45.14 Wh
    energy-empty:        0 Wh
    energy-full:         45.14 Wh
    energy-full-design:  45.14 Wh
    energy-rate:         0 W
    voltage:             8.419 V
    percentage:          100%
    capacity:            73.3279%
    technology:          lithium-ion
    icon-name:          'battery-full-charged-symbolic'

Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         yes
  updated:              Mon 27 Jun 2016 03:43:38 AM EDT (35032 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               fully-charged
    warning-level:       none
    energy:              45.14 Wh
    energy-full:         45.14 Wh
    energy-rate:         0 W
    percentage:          100%
    icon-name:          'battery-full-charged-symbolic'

Daemon:
  daemon-version:  0.99.4
  on-battery:      no
  lid-is-closed:   no
  lid-is-present:  yes
  critical-action: [Invalid UTF-8]

The last line is potentially interesting...

Ok post the contents of /etc/UPower/UPower.conf
You could also compare it to http://paste.fedoraproject.org/385659/70572451/raw/ , I would use the diff command as it's easy to miss mistakes.

Both diff and cmp seem to think they're exactly the same. A quick glance with gvimdiff confirms this.

Here's the contents of my /etc/UPower/UPower.conf, if you want to inspect it yourself:

# Only the system vendor should modify this file, ordinary users
# should not have to change anything.

[UPower]

# Enable the Watts Up Pro device.
#
# The Watts Up Pro contains a generic FTDI USB device without a specific
# vendor and product ID. When we probe for WUP devices, we can cause
# the user to get a perplexing "Device or resource busy" error when
# attempting to use their non-WUP device.
#
# The generic FTDI device is known to also be used on:
#
# - Sparkfun FT232 breakout board
# - Parallax Propeller
#
# default=false
EnableWattsUpPro=false

# Don't poll the kernel for battery level changes.
#
# Some hardware will send us battery level changes through
# events, rather than us having to poll for it. This option
# allows disabling polling for hardware that sends out events.
#
# default=false
NoPollBatteries=false

# Do we ignore the lid state
#
# Some laptops are broken. The lid state is either inverted, or stuck
# on or off. We can't do much to fix these problems, but this is a way
# for users to make the laptop panel vanish, a state that might be used
# by a couple of user-space daemons. On Linux systems, see also
# logind.conf(5).
#
# default=false
IgnoreLid=false

# Policy for warnings and action based on battery levels
#
# Whether battery percentage based policy should be used. The default
# is to use the time left, change to true to use the percentage, which
# should work around broken firmwares. It is also more reliable than
# the time left (frantically saving all your files is going to use more
# battery than letting it rest for example).
# default=true
UsePercentageForPolicy=true

# When UsePercentageForPolicy is true, the levels at which UPower will
# consider the battery low, critical, or take action for the critical
# battery level.
#
# This will also be used for batteries which don't have time information
# such as that of peripherals.
#
# If any value is invalid, or not in descending order, the defaults
# will be used.
#
# Defaults:
# PercentageLow=10
# PercentageCritical=3
# PercentageAction=2
PercentageLow=10
PercentageCritical=3
PercentageAction=2

# When UsePercentageForPolicy is false, the time remaining at which UPower
# will consider the battery low, critical, or take action for the critical
# battery level.
#
# If any value is invalid, or not in descending order, the defaults
# will be used.
#
# Defaults:
# TimeLow=1200
# TimeCritical=300
# TimeAction=120
TimeLow=1200
TimeCritical=300
TimeAction=120

# The action to take when "TimeAction" or "PercentageAction" above has been
# reached for the batteries (UPS or laptop batteries) supplying the computer
#
# Possible values are:
# PowerOff
# Hibernate
# HybridSleep
#
# If HybridSleep isn't available, Hibernate will be used
# If Hibernate isn't available, PowerOff will be used
CriticalPowerAction=HybridSleep

After a reboot into systemd (was running sysvinit before) I get the following output:

$ upower -d
Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path:          AC
  power supply:         yes
  updated:              Mon 27 Jun 2016 06:02:39 PM EDT (213 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              yes
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               SMP
  model:                DELL KWFFN33
  serial:               531
  power supply:         yes
  updated:              Mon 27 Jun 2016 06:04:39 PM EDT (93 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               fully-charged
    warning-level:       none
    energy:              45.14 Wh
    energy-empty:        0 Wh
    energy-full:         45.14 Wh
    energy-full-design:  45.14 Wh
    energy-rate:         0 W
    voltage:             8.344 V
    percentage:          100%
    capacity:            69.8852%
    technology:          lithium-ion
    icon-name:          'battery-full-charged-symbolic'
  History (charge):
    1467065079  100.000 fully-charged

Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         yes
  updated:              Mon 27 Jun 2016 06:02:39 PM EDT (213 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               fully-charged
    warning-level:       none
    energy:              45.14 Wh
    energy-full:         45.14 Wh
    energy-rate:         0 W
    percentage:          100%
    icon-name:          'battery-full-charged-symbolic'

Daemon:
  daemon-version:  0.99.4
  on-battery:      no
  lid-is-closed:   no
  lid-is-present:  yes
  critical-action: PowerOff

But the power configuration stuff still crashes. Interestingly, gnome and mate's power configuration applets haven't been crashing, but of course they mostly seem to have no effect on the system.

I wonder if these warnings when the power panel applet load are related:

(cinnamon:24152): Cjs-WARNING **: JS ERROR: TypeError: this._proxy is undefined
MyApplet.prototype._devicesChanged@/usr/share/cinnamon/applets/[email protected]/applet.js:426
MyApplet.prototype._on_device_aliases_changed@/usr/share/cinnamon/applets/[email protected]/applet.js:293

Post
gsettings list-recursively org.cinnamon.desktop.session

$ gsettings list-recursively org.cinnamon.desktop.session
org.cinnamon.desktop.session session-manager-uses-logind true
org.cinnamon.desktop.session session-name 'cinnamon'
org.cinnamon.desktop.session settings-daemon-uses-logind true
org.cinnamon.desktop.session idle-delay uint32 0
org.cinnamon.desktop.session screensaver-uses-logind true

I am experiencing this bug as well, on two separate desktop PCs with clean installs of Debian stretch amd64 ( cinnamon 3.0.4-1 and upower 0.99.4-3 ).

Here is my output: https://gist.github.com/dbb/3c7a54bf2e4b1bb9026d1b11ec527931

@itzexor (exor on IRC) pointed me to a debian bug reporting this issue, where a fix is presented. This fix seems to work for me. Here's an overly complicated patch for the simple fix:

--- /usr/share/cinnamon/cinnamon-settings/modules/cs_power.py.old   2016-07-10 20:37:31.444503859 -0400
+++ /usr/share/cinnamon/cinnamon-settings/modules/cs_power.py   2016-07-10 20:35:27.224499125 -0400
@@ -98,7 +98,7 @@
             return
         print "Loading Power module"

-        self.up_client = UPowerGlib.Client()
+        self.up_client = UPowerGlib.Client.new()

         self.csd_power_proxy = Gio.DBusProxy.new_sync(
                 Gio.bus_get_sync(Gio.BusType.SESSION, None),

This issue is also present on Ubuntu 16.04.1 with Cinnamon installed from the official Ubuntu repository and @jonorthwash patch fixes the issue. Thank you a lot!

I echo what @FlorianFranzen said.

The @jonorthwash fix worked for my Ubuntu 16.04 system as well (Cinnamon 2.8.6)!

Issue still present in xubuntu 16.04.4, #5439 fixes it.

Was this page helpful?
0 / 5 - 0 ratings