mate-settings-daemon is not running when I try to change the appearance in the control center

Bug #1471254 reported by malheum
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Linux Mint
Confirmed
Undecided
Unassigned

Bug Description

Hello,

I did an install of Linux Mint Mate 17.2 and then copied my user's home directory over from Linux Mint Mate 17.1.

However the theme looks broken, so I tried to change the appearance in the control center.

Then I then do get a msg that the mate-settings-daemon is not running and the newly selected theme is not applied.

Screenshots attached.

BR

Revision history for this message
malheum (maxheise) wrote :
Revision history for this message
malheum (maxheise) wrote :
Revision history for this message
malheum (maxheise) wrote :

Hello,

since the missing themes are "bugging" me, I had a bit of time today to look into this:

First I checked that mate-settings-daemon is really not running:
$> ps ax | grep -i mate-settings-daemon | grep .v grep
returns nothing

I also installed package mate-settings-daemon-dbg.

So I tried to learn something from gdb, but as one can see the started threads do have their own stack, which I do not know how to investigate with gdb, maybe somebody could tell me in the comments on how to do this with gdb, so that I can proceed with looking for the source of this problem.

$> gdb
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) file /usr/bin/mate-settings-daemon
Reading symbols from /usr/bin/mate-settings-daemon...Reading symbols from /usr/lib/debug/.build-id/fd/624e43b19eb185f8567ff69bb523883d560864.debug...done.
done.
(gdb) set args --sync
(gdb) break gdk_x_error()
Function "gdk_x_error()" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Haltepunkt 1 (gdk_x_error()) anstehend.
(gdb) start
Temporärer Haltepunkt 2 at 0x4037a0: file main.c, line 465.
Starting program: /usr/bin/mate-settings-daemon --sync
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Temporary breakpoint 2, main (argc=2, argv=0x7fffffffe238) at main.c:465
465 main.c: Datei oder Verzeichnis nicht gefunden.
(gdb) c
Continuing.
[New Thread 0x7fffef992700 (LWP 5072)]
[New Thread 0x7fffef191700 (LWP 5073)]
The program 'mate-settings-daemon' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
  (Details: serial 486 error_code 8 request_code 140 minor_code 30)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
[Thread 0x7fffef992700 (LWP 5072) exited]
[Thread 0x7ffff7fb69c0 (LWP 5068) exited]
[Inferior 1 (process 5068) exited with code 01]
(gdb) bt
No stack.
(gdb)

BR
M.

Revision history for this message
malheum (maxheise) wrote :

After more gdb reading and the gdb debugging of mate-settings-daemon I came through breakpoints at
mate-settings-manager.c:maybe_activate_plugin and later msd-xrandr-manager.c:344, where I found that mate-settings-daemon was terminating after reading from monitors.xml.

So the reason was a monitors.xml that mate 1.10 did not like ( ~/.config/monitors.xml ).

I deleted ~/.config/monitors.xml and the problem is solved for me. All themes apply again.

Revision history for this message
Flamefire (flamefire2) wrote :

I got a similar problem breaking at mate-settings-manager.c:maybe_activate_plugin and single stepping really helped in finding the problem. In my case this was caused by the monitors.xml in /etc/mate-settings-daemon/xrandr.
This one is however recreated which makes the daemon fail again on next start.

Also strange: I can only start the daemon with sudo, starting it with user rights will make it hang forever after it got the DBus.

I tried to change values in the xml till it worked and found that "<serial>0x00000000</serial>" for one of the 2 monitors was the problem. In this case this is the laptop screen itself. Setting the serial to anything non-zero made it work.

Maybe this should be caught in the daemon or xrandr?

Changed in linuxmint:
status: New → Confirmed
Revision history for this message
Flamefire (flamefire2) wrote :

Error message in my case is:

The error was 'BadMatch (invalid parameter attributes)'.
  (Details: serial 237 error_code 8 request_code 140 minor_code 30)

after single stepping in msd-xrandr-manager.c, lines 329, 335, 329, 335, 329, 330, 335, 337, 340, 339, 342, 340 -> Bug

Call was: apply_configuration_from_filename (manager=manager@entry=0x6520f0,
    filename=filename@entry=0x668530 "/etc/mate-settings-daemon/xrandr/monitors.xml", no_matching_config_is_an_error=no_matching_config_is_an_error@entry=1,
    timestamp=timestamp@entry=0, error=error@entry=0x0)
    at msd-xrandr-manager.c:329

Revision history for this message
Vlad Orlov (monsta) wrote :

Try this for debugging (make sure m-s-d isn't running first):

$ gdb /usr/bin/mate-settings-daemon

Then in gdb console:
(gdb) set env GDK_SYNCHRONIZE 1
(gdb) run

After it crashes:
(gdb) bt full

Then post the output of 'bt full' here (as attachment, cause it might be large).
If some function's details are missing in the stacktrace, make sure you have these packages installed: libmate-desktop-2-17-dbg, libgtk2.0-0-dbg, libglib2.0-0-dbg, libx11-6-dbg, libc6-dbg.

Revision history for this message
Vlad Orlov (monsta) wrote :

Guys, since I can't reproduce this problem, I'd really like to get a backtrace from someone who is able to reproduce it.

Revision history for this message
Flamefire (flamefire2) wrote :

Can't get the backtrace with your method:

gdb /usr/bin/mate-settings-daemon
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/mate-settings-daemon...Reading symbols from /usr/lib/debug/.build-id/1d/a9631b8903d53eeafdef605e84982fa2318bc3.debug...done.
done.
(gdb) set env GDK_SYNCHRONIZE 1
(gdb) run
Starting program: /usr/bin/mate-settings-daemon
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffee9c4700 (LWP 4559)]
[New Thread 0x7fffee1c3700 (LWP 4561)]
The program 'mate-settings-daemon' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
  (Details: serial 239 error_code 8 request_code 140 minor_code 30)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
[Thread 0x7fffee1c3700 (LWP 4561) exited]
[Thread 0x7fffee9c4700 (LWP 4559) exited]
[Inferior 1 (process 4554) exited with code 01]
(gdb) bt
No stack.
(gdb)

also using "run --sync" does not change this.

And still: This is sudo mode. I can't get it to run (it freezes after DBus) in user mode

My current work-around is removing the file /etc/mate-settings-daemon/xrandr/monitors.xml and running "sudo su; mate-settings_daemon&" whenever that bug occurs (almost at every restart)

Revision history for this message
Flamefire (flamefire2) wrote :

Also: My 2-Monitor setup causes related problems. Changing the order in the GUI does not apply it. Have to use "xrandr --output HDMI-1-0 --left-of LVDS-1-0" instead. Note that "~/monitors.xml" is updated correctly though

Revision history for this message
Vlad Orlov (monsta) wrote :

> This is sudo mode. I can't get it to run (it freezes after DBus) in user mode

Is that via gdb?

Revision history for this message
Flamefire (flamefire2) wrote :

It freezes in gdb and without. There is no difference whether I run it w/ or w/o gdb.

Revision history for this message
Vlad Orlov (monsta) wrote :

Really weird... @malheum: maybe you could obtain the backtrace using the steps posted above?

Revision history for this message
Anonymous (reason) wrote :

I'm having the same issue on one of my laptops. mate-settings-daemon often fails to start with this same error message. I've tried altering the "serial" field in ~/.config/monitors.xml to be non-zero, and I've also tried just removing that file and restarting or logout/login. No effect, same error persists for me.

It seems tied to the video driver also. mate-settings-daemon never fails to start when I have the nvidia prime profile set to use only Intel integrated GPU (low-power mode), but when I put it into NVIDIA (performance-mode), then it alwasy fails to start.

It's also tied to multi-monitor setup. If I start in multi-monitor display mode with the external hdmi already connected, mate-settings-daemon fails to start. I have discovered, now, if I start the laptop with NVIDIA performance enabled, but the external HDMI *NOT* connected, then mate-settings-daemon starts. Once the system is started and I'm logged in and themes are applied properly, I can THEN attach the external HDMI cable and it will recognize the second monitor, turn it on, and I get my styles on the second monitor, in NVIDIA perfomance mode, which is the goal.

So, the monitors.xml file definitely seems related, and it seems clear the failure has to do the allocation of video to separate monitors, or just an external monitor. I believe there is some fail case in mate-settings-daemon that is not gracefully handled or reported, but I don't have time to dig through that code and debug the video/monitor output allocation logic.

Revision history for this message
Vlad Orlov (monsta) wrote :

Looks like setting break on gdk_x_error(), like the message suggested, would work better. I was looking at similar crash in mate-maximus and was able to get the backtrace only if that break was set beforehand.

So could you try this guys?

(gdb) set env GDK_SYNCHRONIZE 1
(gdb) break gdk_x_error
(gdb) run

If it says something like this -

Function "gdk_x_error" not defined.
Make breakpoint pending on future shared library load? (y or [n])

- answer 'y'

Revision history for this message
Anonymous (reason) wrote :

I'm still struggling with this issue while using NVidia Prime (performance mode), however, I have made some progress debugging it.

I suddenly couldn't get mate-settings-daemon to start with NVIDIA performance-mode to work, again, after unplugging the second monitor and rebooting, just with the laptop screen as the only monitor (normal laptop mode, single monitor). So I started debugging it again... My suspicion now is that it's not just the "<serial>0x00000000</serial>", but possibly some other lines in the monitor.xml file that are also failing to parse correctly.

See this thread about a very similar issue under Cinnamon desktop:
https://github.com/linuxmint/cinnamon-settings-daemon/issues/52

You can get a "strace" of the function calls leading to mate-settings-daemon dying, using this command:

GDK_SYNCHRONIZE="1" strace cinnamon-settings-daemon

My output looked a lot like the output that was posted in the linked thread, above. I couldn't make much sense of it. I just kept fooling with it until suddenly it magically worked again, so there IS a way to get it to work with a proper monitors.xml file, without all the exotic "fixes" that are proposed there, including just turning off performance mode, which just means not using the more powerful GPU, lol.

This is obviously an upstream bug, because it's appearing in Cinnamon also. We need to figure out which repo maintainer is responsible for this error message:

BadMatch (invalid parameter attributes)

and what exactly it's trying to "match" those attributes to in the monitors.xml file. Then we need to get that fixed, upstream, so it doesn't die and is a little smarter about handilng that "mismatch", and then we need kernels patched in the kernels which ship with Mate and Cinnamon.

Revision history for this message
Anonymous (reason) wrote :

Hmmmm, linked from the thread in cinnamon, is a sample of a patch to some source code in cinnamon-settings-daemon, it appears the issue may actually have been patched in that repo, just not made it into a stable release yet.

Can we get this patch into mate-settings-daemon also, and then into the stable ubunty-mate / mint-mate kernels?

https://github.com/linuxmint/cinnamon-desktop/commit/dab0d63d766b102d6d54e44e69956d7fe0b9b73f

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.