Desktop crash when using the shutdown button

Installed Ubuntu Mate recently on my gaming rig. Must say I’m impressed, every game works flawlessly and performance is amazing. I also use this rig to watch some videos.

I have a vanilla install with a few extra apps (chrome and steam)

I was experiencing some bad screen tearing issues in the desktop (while scrolling or moving around windows), playing videos(plex, youtube, netflix) and in games. I fixed it by adding to the xorg.conf, under the screen section the following:

Option         "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"

This took care of all screen tearing issues, but since then, every time I use the shutdown button, the desktop environment sort of crashes (all icons turns to red X) and eventually shutdowns, but only after several seconds (previously was instantaneous) like it is hitting a time out or something. This is a picture of the issue:

https://drive.google.com/file/d/0B9OiUsNVqFrud0tnTU0tOTV0WWxSbWFYbFhBb3U0d09PdV9r/view?usp=sharing

If I shutdown from the command line, there is no problem. I have an nvidia gtx980 with the propietary drives (355 using the official Ubuntu graphic drivers ppa)

I found the following errors in the xorg error log, but googling for that didn’t help much:

nm-applet-Message: using fallback from indicator to GtkStatusIcon
** Message: Initializing gksu extension...
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:50: RuntimeWarning: You have imported the Gtk 2.0 module.  Because Gtk 2.0 was not designed for use with introspection some of the interfaces and API will fail.  As such this is not supported by the pygobject development team and we encourage you to port your app to Gtk 3 or greater. PyGTK is the recomended python module to use with Gtk 2.0
  warnings.warn(warn_msg, RuntimeWarning)

** (caja:1370): CRITICAL **: caja_menu_provider_get_background_items: assertion 'CAJA_IS_MENU_PROVIDER (provider)' failed

** (caja:1370): CRITICAL **: caja_menu_provider_get_background_items: assertion 'CAJA_IS_MENU_PROVIDER (provider)' failed
Traceback (most recent call last):
  File "/usr/bin/blueman-applet", line 120, in <module>
    BluemanApplet()
  File "/usr/bin/blueman-applet", line 62, in __init__
    self.Plugins.Load()
  File "/usr/lib/python2.7/dist-packages/blueman/main/PluginManager.py", line 90, in Load
    __import__(self.module_path.__name__ + ".%s" % plugin, None, None, [])
  File "/usr/lib/python2.7/dist-packages/blueman/plugins/applet/DBusService.py", line 12, in <module>
    from blueman.main.applet.BluezAgent import AdapterAgent
  File "/usr/lib/python2.7/dist-packages/blueman/main/applet/BluezAgent.py", line 20, in <module>
    from blueman.bluez.Agent import Agent, AgentMethod
  File "/usr/lib/python2.7/dist-packages/blueman/bluez/Agent.py", line 48, in <module>
    class Agent(dbus.service.Object):
  File "/usr/lib/python2.7/dist-packages/blueman/bluez/Agent.py", line 56, in Agent
    @AgentMethod
  File "/usr/lib/python2.7/dist-packages/blueman/bluez/Agent.py", line 38, in AgentMethod
    if BlueZInterface.get_interface_version()[0] < 5:
  File "/usr/lib/python2.7/dist-packages/blueman/bluez/BlueZInterface.py", line 16, in get_interface_version
    obj = dbus.SystemBus().get_object('org.bluez', '/')
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.TimedOut: Failed to activate service 'org.bluez': timed outs

(mate-power-manager:1377): GLib-CRITICAL **: Source ID 79 was not found when attempting to remove it
[3244:3244:1030/201403:ERROR:background_mode_manager_aura.cc(14)] Not implemented reached in virtual void BackgroundModeManager::EnableLaunchOnStartup(bool)
Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x3600001 (New Tab - )
Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.
[1,864053120:18:14:03.616555] Native Client module will be loaded at base address 0x000052ff00000000
[WARNING:flash/platform/pepper/pep_module.cpp(63)] SANDBOXED
[3244:3274:1030/201810:ERROR:channel.cc(307)] RawChannel read error (connection broken)
[3244:3274:1030/202230:ERROR:channel.cc(307)] RawChannel read error (connection broken)
[3244:3274:1030/203206:ERROR:channel.cc(307)] RawChannel read error (connection broken)

(mate-screensaver:1421): GLib-CRITICAL **: Source ID 195 was not found when attempting to remove it
[3244:3274:1030/221107:ERROR:channel.cc(307)] RawChannel read error (connection broken)
[3244:3274:1030/224206:ERROR:channel.cc(307)] RawChannel read error (connection broken)
[3244:3274:1030/230308:ERROR:channel.cc(307)] RawChannel read error (connection broken)
[3244:3274:1030/233807:ERROR:channel.cc(307)] RawChannel read error (connection broken)

(mate-power-manager:1377): GLib-CRITICAL **: Source ID 84 was not found when attempting to remove it

** (mate-panel:1334): WARNING **: Could not ask session manager to shut down: Shutdown interface is only available during the Running phase
mate-session: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.

Most interesting seems the last line, about shutdown interface.
Any ideas?

I also have an NVIDIA card (GTX 960) that experienced screen tearing, and using the same extra lines for /etc/X11/xorg.conf had fixed it, except that I also have this added this just before it:

Option "TripleBuffer" "True"

You could try that if this changes anything. I’ve only witnessed what is shown on your screenshot once the past year, it’s extremely rare.

I’m not 100% sure what’s happening here, but it’s definitely looks like an issue with mate-panel communicating to the X (display) server since you modified xorg.conf.

You could run top in a terminal (press Enter to refresh) while shutting down to see if there is a process that is locking up too. Which version of Ubuntu MATE are you using?

Hi,

Thank you very much for the reply! My Ubuntu Version is 15.10, sorry I forgot to mention that important bit on info.

Adding that line actually worked, I don’t get the same error anymore, although shutdown is still taking more time than expected.

I tried your suggestion, and according to top, Xorg was still running on top while shutting down.

What is that triple buffer option doing? any disadvantages on leaving that on?

Update: So I talked to soon, it only worked for the first shutdown after editing xorg.conf. The error still occurs. I should also mention that is happening consistently (every single time I press shutdown)

I don’t really know. :frowning: In general, a quick search reveals:

Triple buffering simply buffers one extra frame to the cpu instead of two. This extra frame gives enough time to correct more issues such as frame tearing and Vsync. It also has drawbacks. A extra frame being buffered by the GPU means it must use more on-board GPU memory to store and buffer that frame.

It was part of a solution I found when I had tearing issues many months ago, but nether of these cause issues when shutting down.

Just in case it helps, this is what my /etc/X11/xorg.conf looks like:

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 346.59  (buildd@toyol)  Thu Apr  9 09:44:23 UTC 2015
Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection
Section "Files"
EndSection
Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection
Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "ViewSonic VX2260WM"
    HorizSync       15.0 - 82.0
    VertRefresh     50.0 - 75.0
    Option         "DPMS"
EndSection
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 960"
EndSection
Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "TripleBuffer" "True"
    Option         "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Did you add these lines directly to /etc/X11/xorg.conf like I did? I wonder if yours was also generated by nvidia-settings (like here) which may have some other options that isn’t affecting Xorg when shutting down.

Hi,

Thank you for posting you settings, I’ll compare and try tweaking if I see differences.
I did use nvidia-xconfig to generate the xorg.conf file and then manually added that extra line.

This is not such a huge deal, but it its annoying having to shutdown from the command line. Should I open a bug report? Where would the place to that be?

Bugs can be reported to the Ubuntu MATE project on Launchpad, although it’s probably best to hold off reporting it until you can easily reproduce it and provide steps so others who experience the same problem can confirm the problem too.

There is a crude workaround - You could add a launcher to the panel that executes sudo shutdown -p now (or sudo shutdown -r now for restart) and then modify the sudoers file (using sudo visudo) file so that you do not need to type the password every time.

After visudo in the text editor, add this line:

YourName *tab* ALL=NOPASSWD: *tab* /sbin/shutdown

(Replace YourName with your actual username)