gnome-settings-daemon crashed with SIGSEGV in gsd_mouse_manager_start()

Bug #204850 reported by Samant Maharaj
42
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gnome-settings-daemon (Ubuntu)
Fix Released
Medium
Ubuntu Desktop Bugs

Bug Description

Binary package hint: gnome-settings-daemon

1/
Description: Ubuntu hardy (development branch)
Release: 8.04

2/
gnome-settings-daemon:
  Installed: 2.22.0-0ubuntu1
  Candidate: 2.22.0-0ubuntu1
  Version table:
 *** 2.22.0-0ubuntu1 0
        500 http://nz.archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status

3/
I attempted to log in a new session via Xvnc. I had configured GDM for XDMCP. The login succeeded but I received several errors indicating that gnome-settings-daemon had crashed.

4/
The newly logged in gnome session used the default themes and icons.

ProblemType: Crash
Architecture: amd64
CrashCounter: 1
Date: Sat Mar 22 10:42:33 2008
DistroRelease: Ubuntu 8.04
ExecutablePath: /usr/lib/gnome-settings-daemon/gnome-settings-daemon
NonfreeKernelModules: nvidia
Package: gnome-settings-daemon 2.22.0-0ubuntu1
PackageArchitecture: amd64
ProcCmdline: gnome-settings-daemon
ProcEnviron:
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=en_NZ.UTF-8
 SHELL=/bin/bash
Signal: 11
SourcePackage: gnome-settings-daemon
StacktraceTop:
 ?? ()
 gsd_mouse_manager_start ()
 ?? ()
 gnome_settings_plugin_info_activate ()
 ?? ()
Title: gnome-settings-daemon crashed with SIGSEGV in gsd_mouse_manager_start()
Uname: Linux 2.6.24-12-generic x86_64
UserGroups: adm audio cdrom dialout dip fax floppy fuse lpadmin mythtv plugdev scanner tape video

Tags: apport-crash
Revision history for this message
Samant Maharaj (samboneym) wrote :
Revision history for this message
Apport retracing service (apport) wrote : Symbolic stack trace

StacktraceTop:gsd_mouse_manager_start (manager=0x65eac0, error=<value optimized out>)
impl_activate (plugin=0x65ea90) at gsd-mouse-plugin.c:78
gnome_settings_plugin_info_activate (info=0x636af0)
maybe_activate_plugin (info=0x636af0, user_data=<value optimized out>)
IA__g_slist_reverse (list=0x6286e8)

Revision history for this message
Apport retracing service (apport) wrote : Symbolic threaded stack trace
Changed in gnome-settings-daemon:
importance: Undecided → Medium
Revision history for this message
Sebastien Bacher (seb128) wrote :

The crash is due to an ubuntu change

Revision history for this message
mabawsa (mabawsa) wrote :

Is there a fix?

Revision history for this message
Matthew Kent (mkent) wrote :

+1, seeing this here as well.

Revision history for this message
Bart Heinsius (bheinsius) wrote :

I run into this problem too, login via Xnest.

Revision history for this message
Patrick J. LoPresti (lopresti) wrote :

Same issue here. On amd64, under Xvnc4, when I run "gnome-settings-daemon", I get:

** (gnome-settings-daemon:1422): WARNING **: The X Server does not support the XRandR extension. Runtime resolution changes to the display size are not available.

** (gnome-settings-daemon:1422): WARNING **: numlock: XkbQueryExtension returned an error

** (gnome-settings-daemon:1422): WARNING **: Neither XKeyboard not Xfree86's keyboard extensions are available,
no way to support keyboard autorepeat rate settings
Shutdown failed or nothing to shut down.
Xlib: extension "XInputExtension" missing on display ":17.0".
Segmentation fault (core dumped)

The core file produces the same backtrace (gsd_mouse_manager_start) described in this bug.

Revision history for this message
Dimitry Andric (dimitry-andric) wrote :

I'm having precisely the same problem as the people in this bug report, and almost exactly the same backtrace. :)

I downloaded the debug symbols, and this is what I got:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f1966f937a0 (LWP 19394)]
set_touchpad_enabled (state=<value optimized out>) at gsd-mouse-manager.c:420
420 gsd-mouse-manager.c: No such file or directory.
 in gsd-mouse-manager.c
(gdb) bt
#0 set_touchpad_enabled (state=<value optimized out>) at gsd-mouse-manager.c:420
#1 0x00007f195a26a8cd in gsd_mouse_manager_start (manager=0x660af0, error=<value optimized out>) at gsd-mouse-manager.c:836
#2 0x00007f195a2697f7 in impl_activate (plugin=0x660ac0) at gsd-mouse-plugin.c:78
#3 0x0000000000404f0c in gnome_settings_plugin_info_activate ()
#4 0x0000000000403c85 in ?? ()
#5 0x00007f1962928e0d in g_slist_foreach () from /usr/lib/libglib-2.0.so.0
#6 0x0000000000403e94 in gnome_settings_manager_start ()
#7 0x0000000000403ad8 in main ()
(gdb) print devicelist
$1 = (XDeviceInfo *) 0x0
(gdb) print numdevices
$2 = 32537

In my case, I'm running a GNOME session under VNC server, which does NOT support the XInputExtension. However, the set_touchpad_enabled() function in plugins/mouse/gsd-mouse-manager.c (which was introduced by debian/patches/08_extra_touchpad_options.patch) uses XListInputDevices() to get a list anyway:

static int
set_touchpad_enabled (gboolean state)
{
        int numdevices, i;
        int values[2];
        XDeviceInfo *devicelist = XListInputDevices (GDK_DISPLAY(), &numdevices);
 [...]
        for (i = 0; i < numdevices; i++) {
                if (strcmp (devicelist[i].name, "Synaptics Touchpad") == 0) {

The problem, as you can see in the gdb conversation above, is that if devicelist is NULL, numdevices is *not* set to zero by the call to XListInputDevices. Later on, the for loop will segfault in the first strcmp() call.

I've attached a patch which fixes at least this particular problem.

Revision history for this message
Pedro Villavicencio (pedro) wrote :

Thanks for your work on it, Sebastien may you take a look to the patch? thanks in advance.

Changed in gnome-settings-daemon:
assignee: nobody → desktop-bugs
status: New → Triaged
Revision history for this message
Patrick J. LoPresti (lopresti) wrote :

Thank you, Dmitry! Your patch works great (modulo one problem; see below).

In case anybody else wants to fix this for themselves, here are a step-by-step instructions to apply the patch:

- Download Dmitry's patch from the link above
- Become root
- Edit /etc/apt/sources.list to ensure you have a "deb-src" line matching your "deb" line for the main Ubuntu archive
$ apt-get update # (necessary if you modified sources.list)
$ apt-get build-dep gnome-settings-daemon
$ apt-get source gnome-settings-daemon
$ cd gnome-settings-daemon-2.22.1
$ cp /path/to/09_extra_touchpad_options_fix.patch ./debian/patches
$ ./debian/rules binary
$ dpkg -i ../gnome-settings-daemon_2.22.1-0ubuntu1_amd64.deb

That's it. To ensure your custom package does not get replaced when you apply updates, you might want to run "aptitude hold gnome-settings-manager".

Now, the problem. Although this fixes the segfault, it exposes the next issue, which is that whenever I close any window, the gnome-settings-manager dies with an X error. I worked around this by applying the patch below and rebuilding, but this is almost certainly the "wrong" fix, breaks something when not being used in a VNC session, etc. I am only including it because a) it works for me and b) it might help an expert locate and fix the issue for real.

Thank you again, Dmitry. The blinking cursor in gnome-terminal was driving me nuts. :-)

diff -u -r gnome-settings-daemon-2.22.1-orig/plugins/keyboard/gsd-keyboard-xkb.c gnome-settings-daemon-2.22.1/plugins/keyboard/gsd-keyboard-xkb.c
--- gnome-settings-daemon-2.22.1-orig/plugins/keyboard/gsd-keyboard-xkb.c 2008-03-27 06:11:19.000000000 -0700
+++ gnome-settings-daemon-2.22.1/plugins/keyboard/gsd-keyboard-xkb.c 2008-08-25 10:57:46.000000000 -0700
@@ -279,7 +279,7 @@
                              GdkEvent * event)
 {
         XEvent *xevent = (XEvent *) xev;
- xkl_engine_filter_events (xkl_engine, xevent);
+ /*xkl_engine_filter_events (xkl_engine, xevent);*/
         return GDK_FILTER_CONTINUE;
 }

Revision history for this message
Dimitry Andric (dimitry-andric) wrote :

Yes, that BadWindow error is indeed the next error. You can duct-tape-fix it using your patch, or by simply disabling the gnome-settings-daemon keyboard plugin (using gconf-editor).

The BadWindow error is researched in bug 199245, bug 254671, and possibly others (even http://bugzilla.gnome.org/show_bug.cgi?id=537592)... but it's a strange one, looks like some race condition or bad event interaction.

Changed in gnome-settings-daemon:
milestone: none → ubuntu-9.04-beta
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-settings-daemon - 2.25.92-0ubuntu2

---------------
gnome-settings-daemon (2.25.92-0ubuntu2) jaunty; urgency=low

  * debian/patches/08_extra_touchpad_options.patch:
    - updated to not crash when there is no device listed,
      thank to Dimitry Andric who suggested the change (lp: #204850)

 -- Sebastien Bacher <email address hidden> Tue, 03 Mar 2009 11:14:31 +0100

Changed in gnome-settings-daemon:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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