gnome-settings-daemon crashed with signal 5 in xkl_process_error()

Bug #805894 reported by mike@papersolve.com
672
This bug affects 96 people
Affects Status Importance Assigned to Milestone
gnome-settings-daemon (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Here's a note I included in a similar bug (797947) that may help to diagnose as this might be a timing issue:

I'd like to add that I can never get gnome-settings-daemon to start and stay running for more than 5 seconds, UNLESS i take the following actions, in which case it applies the themes properly and responds to theme changes and generally works just fine:

1. start 'strace gnome-settings-daemon' in a window
2. wait until the terminal appears to hang in the middle of the output
3. switch to a virtual console (ALT+F1) and login
4. pkill -9 strace
5. switch back to X - everything is fine!

This works about 95% of the time.

This is a laptop that always gets this error on boot up and only has one screen, no docking station, so its not anything related to screen size I should think.

ProblemType: Crash
DistroRelease: Ubuntu 11.10
Package: gnome-settings-daemon 3.1.2-0ubuntu1
ProcVersionSignature: Ubuntu 3.0-2.3-generic 3.0.0-rc4
Uname: Linux 3.0-2-generic i686
Architecture: i386
Date: Sun Jul 3 10:35:32 2011
ExecutablePath: /usr/lib/gnome-settings-daemon/gnome-settings-daemon
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Alpha i386 (20100602.2)
ProcCmdline: /usr/lib/gnome-settings-daemon/gnome-settings-daemon
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
Signal: 5
SourcePackage: gnome-settings-daemon
StacktraceTop:
 ?? () from /usr/lib/libgdk-3.so.0
 ?? () from /usr/lib/libgdk-3.so.0
 xkl_process_error () from /usr/lib/libxklavier.so.16
 _XError () from /usr/lib/i386-linux-gnu/libX11.so.6
 ?? () from /usr/lib/i386-linux-gnu/libX11.so.6
Title: gnome-settings-daemon crashed with signal 5 in xkl_process_error()
UpgradeStatus: Upgraded to oneiric on 2011-06-05 (29 days ago)
UserGroups: adm admin cdrom dialout games libvirtd lpadmin plugdev sambashare

Revision history for this message
mike@papersolve.com (mike-papersolve) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 _gdk_x11_display_error_event (display=0x862c000, error=0xbfa3d3cc) at /build/buildd/gtk+3.0-3.1.6/./gdk/x11/gdkdisplay-x11.c:2374
 gdk_x_error (xdisplay=0x8621550, error=0xbfa3d3cc) at /build/buildd/gtk+3.0-3.1.6/./gdk/x11/gdkmain-x11.c:312
 gdk_x_error (xdisplay=0x8621550, error=0xbfa3d3cc) at /build/buildd/gtk+3.0-3.1.6/./gdk/x11/gdkmain-x11.c:275
 xkl_process_error (dpy=0x8621550, evt=0xbfa3d3cc) at xklavier_evt.c:542
 _XError (dpy=0x8621550, rep=0x873b7a8) at ../../src/XlibInt.c:1583

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in gnome-settings-daemon (Ubuntu):
importance: Undecided → Medium
tags: removed: need-i386-retrace
Changed in gnome-settings-daemon (Ubuntu):
status: New → Confirmed
tags: added: bugpattern-needed
visibility: private → public
Revision history for this message
mike@papersolve.com (mike-papersolve) wrote :
Download full text (6.0 KiB)

After reading more of a related RedHat bug (https://bugzilla.redhat.com/show_bug.cgi?id=657726) it would seem that these crashes are in fact due to some bad messages coming back from xklavier or xinput, and gnome-settings-daemon not being able to handle them. Here is a recent stack trace:

mike@hawty:~$ gdb gnome-settings-daemon
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
Copyright (C) 2011 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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/bin/gnome-settings-daemon...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/gnome-settings-daemon
[Thread debugging using libthread_db enabled]
[New Thread 0xb7ddbb70 (LWP 3131)]
[New Thread 0xb75dab70 (LWP 3132)]
[New Thread 0xb6bffb70 (LWP 3133)]

** (gnome-settings-daemon:3128): WARNING **: Ignoring unknown module 'org.gnome.settings-daemon.plugins.ubuntuone'
[New Thread 0xb63feb70 (LWP 3134)]
[Thread 0xb75dab70 (LWP 3132) exited]
[1316688537,000,xklavier.c:xkl_engine_start_listen/] The backend does not require manual layout management - but it is provided by the application

Gdk-ERROR **: The program 'gnome-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 846 error_code 8 request_code 141 minor_code 22)
  (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.)

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00810e69 in g_logv () from /lib/i386-linux-gnu/libglib-2.0.so.0
(gdb) bt
#0 0x00810e69 in g_logv () from /lib/i386-linux-gnu/libglib-2.0.so.0
#1 0x008111a3 in g_log () from /lib/i386-linux-gnu/libglib-2.0.so.0
#2 0x00a79ec9 in ?? () from /usr/lib/libgdk-3.so.0
#3 0x00a87c28 in ?? () from /usr/lib/libgdk-3.so.0
#4 0x0163d99a in xkl_process_error () from /usr/lib/libxklavier.so.16
#5 0x00b06d3b in _XError () from /usr/lib/i386-linux-gnu/libX11.so.6
#6 0x00b0390d in ?? () from /usr/lib/i386-linux-gnu/libX11.so.6
#7 0x00b048f7 in _XReply () from /usr/lib/i386-linux-gnu/libX11.so.6
#8 0x00ea8f3b in XGetFeedbackControl ()
   from /usr/lib/i386-linux-gnu/libXi.so.6
#9 0x01845fcb in ?? () from /usr/lib/gnome-settings-daemon-3.0/libmouse.so
#10 0x01847a6c in ?? () from /usr/lib/gnome-settings-daemon-3.0/libmouse.so
#11 0x01847d77 in ?? () from /usr/lib/gnome-settings-daemon-3.0/libmouse.so
#12 0x008041a0 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#13 0x008082ef in g_main_context_dispatch ()
   from /lib/i386-linux-gnu/libglib-2.0.so.0
#14 0x00808a20 in ?? () from...

Read more...

Revision history for this message
mike@papersolve.com (mike-papersolve) wrote :

Besides just removing the device, I can also do

xinput --set-prop "Western Digital My Book" "Device Enabled" 0

every time X comes up and then re-start gnome-settings-daemon. I just wish it could handle this error so I didn't have to!

Revision history for this message
Jared (jared-vanvolkenburg) wrote :

This occurred after boot up and logging into unity. I took no other actions. 11.10 beta 2

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

Is there any easy way to trigger the crash ? may you tell us a few easy steps in order to do so? If you can reproduce it , may you please provide us a backtrace with latest package ? please read https://wiki.ubuntu.com/DebuggingProgramCrash to know how to do it, and if you have questions please don't hesitate in asking, thanks all.

Changed in gnome-settings-daemon (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
mike@papersolve.com (mike-papersolve) wrote : RE: [Bug 805894] Re: gnome-settings-daemon crashed with signal 5 inxkl_process_error()

In my case, I can reproduce it and I included the backtrace above yesterday. I have found the issue is because an external USB hard disk (a western digital MyBook 1TB Mirror edition, although other WD MyBook devices also seem to have the same problem) is announcing itself not only as a hard disk but also as an input device, confusing xklavier and then this crashes gnome-settings-daemon.

Jared -- do you have the same issue? If you do "xinput list" do you see any devices that are not really input devices in that list?

Sincerely,

Michael Russo, Systems Engineer
PaperSolve, Inc.
268 Watchogue Road
Staten Island, NY 10314

Randomly generated quote of the last 5 minutes:
Dijkstra probably hates me.
  -- Linus Torvalds, in kernel/sched.c

Revision history for this message
Thomas Schwiertz (thomas-schwiertz) wrote :

Also getting this error from time to time, but I'm not using any external USB HDD. Just have a NAS attached to my Network. But I can't say it always happens when I access my NAS. So far the error seems quite randomly from my side. Couldn't figure out any fixed steps to reproduce this error.

Revision history for this message
Jared (jared-vanvolkenburg) wrote :

I did have an external USB drive attached earlier, along with several other USB devices attached to a USB hub. However; I just got the crash again after booting and do not have any USB devices attached at all.

Revision history for this message
Jared (jared-vanvolkenburg) wrote :

Two other things of note, I am not sure if they are relevant:
First, I have the Blueman Applet starting up as one of my Startup Applications. I do not have an internal bluetooth chip on my netbook, and so have a small bluetooth USB dongle which is usually attached to the USB Hub I use as a 'docking station' for my netbook when I am at home and using a larger monitor, external wireless keyboard, mouse etc. However, this time, I did not have any USB devices attached, including the bluetooth dongle, and the blueman applet still was started in my Startup Applications without the hardware attached. The crash occurred about 30 seconds after login.

Second, I have observed a few times, that the Ubuntu One Indicator sometimes seems to take awhile to startup and connect, indicated by 'lighting up' It seems that when the crash occurs it is usually one of the times that Ubuntu One seems to be delayed in connecting. It does not seem that every time Ubuntu One is delayed I receive this crash however, and Ubuntu One is not delayed on every boot.

Just 2 observations, like I said they may not be relevant, but they may help. Let me know.

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

Is this still reproducible with g-s-d 3.2? There's no duplicates with that version . Thanks.

Revision history for this message
mike@papersolve.com (mike-papersolve) wrote :
Download full text (3.3 KiB)

Unfortunately yes, at least for me. In my case it definitely has to do with the fact that I have a USB hard disk reporting itself as a keyboard, this is confusing xklavier and causing gsd to crash. I run the command "xinput --set-prop "Western Digital My Book" "Device Enabled" 0" in my .xstartup and start gsd manually and this fixes it for me but I don’t think for other people. Gsd needs to handle errors better from xklavier apparently.

Sincerely,

Michael Russo, Systems Engineer
PaperSolve, Inc.
268 Watchogue Road
Staten Island, NY 10314

Randomly generated quote of the last 5 minutes:
Swipple's Rule of Order:
 He who shouts the loudest has the floor.
-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Pedro Villavicencio
Sent: Friday, October 07, 2011 9:51 AM
To: Mike Russo
Subject: [Bug 805894] Re: gnome-settings-daemon crashed with signal 5 inxkl_process_error()

Is this still reproducible with g-s-d 3.2? There's no duplicates with that version . Thanks.

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/805894

Title:
  gnome-settings-daemon crashed with signal 5 in xkl_process_error()

Status in “gnome-settings-daemon” package in Ubuntu:
  Incomplete

Bug description:
  Here's a note I included in a similar bug (797947) that may help to
  diagnose as this might be a timing issue:

  I'd like to add that I can never get gnome-settings-daemon to start
  and stay running for more than 5 seconds, UNLESS i take the following
  actions, in which case it applies the themes properly and responds to
  theme changes and generally works just fine:

  1. start 'strace gnome-settings-daemon' in a window
  2. wait until the terminal appears to hang in the middle of the output
  3. switch to a virtual console (ALT+F1) and login
  4. pkill -9 strace
  5. switch back to X - everything is fine!

  This works about 95% of the time.

  This is a laptop that always gets this error on boot up and only has
  one screen, no docking station, so its not anything related to screen
  size I should think.

  ProblemType: Crash
  DistroRelease: Ubuntu 11.10
  Package: gnome-settings-daemon 3.1.2-0ubuntu1
  ProcVersionSignature: Ubuntu 3.0-2.3-generic 3.0.0-rc4
  Uname: Linux 3.0-2-generic i686
  Architecture: i386
  Date: Sun Jul 3 10:35:32 2011
  ExecutablePath: /usr/lib/gnome-settings-daemon/gnome-settings-daemon
  InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Alpha i386 (20100602.2)
  ProcCmdline: /usr/lib/gnome-settings-daemon/gnome-settings-daemon
  ProcEnviron:
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  Signal: 5
  SourcePackage: gnome-settings-daemon
  StacktraceTop:
   ?? () from /usr/lib/libgdk-3.so.0
   ?? () from /usr/lib/libgdk-3.so.0
   xkl_process_error () from /usr/lib/libxklavier.so.16
   _XError () from /usr/lib/i386-linux-gnu/libX11.so.6
   ?? () from /usr/lib/i386-linux-gnu/libX11.so.6
  Title: gnome-settings-daemon crashed with signal 5 in xkl_process_error()
  UpgradeStatus: Upgraded to oneiric on 2011-06-05 (29 days ago)
  ...

Read more...

Revision history for this message
Sebastien Bacher (seb128) wrote :

interesting mike, how did you figure your disk is detected as a keyboard? could you send the bug to GNOME?

Revision history for this message
mike@papersolve.com (mike-papersolve) wrote :

Sebastien - I'm pretty sure I was able to glean the information from stuff on the internet, but doing "xinput list" and seeing it there certainly confirmed it. Finding error messages in xkl functions also helped. Others say this isn't their issue though.

Revision history for this message
Erwin Rohde (errier) wrote :

I can confirm that this bug happens in Ubuntu 11.10 if a Western Digital My Book (1 Tb mirroring) is connected through USB.
Disconnecting the WD results in a gnome-settings-daemon that doesn't crash.

This bug can be temporarily fixed by executing the following script as startup item in "Startup Applications" :

#!/bin/bash
xinput --set-prop "Western Digital My Book" "Device Enabled" 0
nohup gnome-settings-daemon & > /dev/null
killall nautilus
nohup nautilus -n & > /dev/null

This is the part in my /var/log/udev that shows that udev is seeing the USB HDD as a hid device.
I'm no udev expert, so I might be wrong about this.

KERNEL[12.524293] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.1/0003:1058:1105.0002 (hid)
UDEV_LOG=3
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.1/0003:1058:1105.0002
SUBSYSTEM=hid
DRIVER=generic-usb
HID_ID=0003:00001058:00001105
HID_NAME=Western Digital My Book
HID_PHYS=usb-0000:00:1d.0-1.5/input1
HID_UNIQ=575532513130303833303330
MODALIAS=hid:b0003v00001058p00001105
SEQNUM=1537

KERNEL[12.524319] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.1/0003:1058:1105.0002/hidraw/hidraw1 (hidraw)
UDEV_LOG=3
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.1/0003:1058:1105.0002/hidraw/hidraw1
SUBSYSTEM=hidraw
DEVNAME=hidraw1
SEQNUM=1538
MAJOR=251
MINOR=1

Revision history for this message
Thomas Schwiertz (thomas-schwiertz) wrote :

Interesting, beforehand I didn't had any problems with external HDD but since some recent update now it happens that whatever external USB Data device I connect (USB Stick, Amazon Kindle, Mobile Phone,...) nautilus crashes without apport generating any error report at all. And afterwards I can't open nautilus at all, even after removing the USB device. Need to reboot the client.

Revision history for this message
Robert Adams (pillage) wrote :

I can confirm the exact same behavior witnessed by Mike in comment #5 and Erwin above. In my case I have been trying to troubleshoot the extreme lack of theming in Oneiric - it never occurred to me to unplug my external WD My Book, which has been "recognized" as a keyboard for as long as I can remember but has never given me any difficulty.

Once unplugged, I can start gnome-settings-daemon fine, and windows are themed.

(gnome-settings-daemon:4587): Gdk-WARNING **: The program 'gnome-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 873 error_code 8 request_code 143 minor_code 22)
  (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 0x7fffedda5700 (LWP 4591) exited]
[Thread 0x7fffed5a4700 (LWP 4592) exited]
[Thread 0x7fffee5a6700 (LWP 4590) exited]
[Inferior 1 (process 4587) exited with code 01]
(gdb) q
rob@ig:~ $ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech USB-PS/2 Optical Mouse id=9 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
    ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
    ↳ Power Button id=6 [slave keyboard (3)]
    ↳ Power Button id=7 [slave keyboard (3)]
    ↳ DecK Deck Legend id=8 [slave keyboard (3)]
    ↳ Western Digital My Book id=10 [slave keyboard (3)]

Revision history for this message
Erwin Rohde (errier) wrote :

Bug still present in 12.04

Revision history for this message
Alessandro Lazzari (lazzari-alessandro) wrote :

Bug still present 12.10

Revision history for this message
Håkon A. Hjortland (post-hakn) wrote :

According to the stack trace in #3, the error seems to occur when set_motion calls XGetFeedbackControl.

From man XGetFeedbackControl:
A BadMatch error will be generated if the requested device does not support feedbacks. Whether or not a given device supports feedbacks can be determined by examining the information returned by the XOpenDevice request. For those devices that support feedbacks, XOpenDevice will return an XInputClassInfo structure with the input_class field equal to the constant FeedbackClass (defined in the file XI.h).

Since set_motion (from the gnome-settings-daemon source file gsd-mouse-manager.c) does not perform this check before calling XGetFeedbackControl, that is probably the problem.

According to "xinput list --long" the harddisk is a keyboard with mouse buttons(!):
--------------------------------------------------------------------------------
Western Digital My Book id=9 [slave keyboard (3)]
 Reporting 1 classes:
  Class originated from: 9. Type: XIButtonClass
  Buttons supported: 20
  Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" "Button Side" "Button Extra" "Button Forward" "Button Back" "Button Task" "Button 8" "Button 9" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown"
--------------------------------------------------------------------------------
This probably explains why the problem occurs in a mouse handling function.

To fix the problem, we just have to check if the device supports feedbacks before calling XGetFeedbackControl. See attached patch for the gnome-settings-daemon package.

I don't know very much about X programming, so the patch needs review from someone who knows what they're doing. It seems to work nicely for me so far, though.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch for the gnome-settings-daemon package" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Håkon A. Hjortland (post-hakn) wrote :

Fixed the indentation.

Revision history for this message
Paul Hebble (maceo) wrote :

Håkon's patch also fixed this for me. (Sorry if I wasn't supposed to change the status; I didn't think it would let me.)

Changed in gnome-settings-daemon (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Alessandro Lazzari (lazzari-alessandro) wrote :

This bug is not present in the current Raring development build.

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.