gnome-settings-daemon dies with BadMatch

Bug #447431 reported by Steve Langasek on 2009-10-09
128
This bug affects 30 people
Affects Status Importance Assigned to Milestone
gnome-desktop (Ubuntu)
Medium
Unassigned

Bug Description

Binary package hint: gnome-settings-daemon

g-s-d frequently dies for me when I'm flipping through display output settings.

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 172881 error_code 8 request_code 149 minor_code 7)
  (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.)

This is the first time I happened to have launched it from console (restarting it after a previous crash) and caught this error message. I'll try to debug it using --sync.

ProblemType: Bug
Architecture: amd64
Date: Fri Oct 9 10:27:23 2009
DistroRelease: Ubuntu 9.10
Package: gnome-settings-daemon 2.28.0-0ubuntu2
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-11.38-generic
SourcePackage: gnome-settings-daemon
Uname: Linux 2.6.31-11-generic x86_64

Steve Langasek (vorlon) wrote :
Steve Langasek (vorlon) wrote :

except that I can't actually break on gdk_x_error in gdb, even with libgtk2.0-0-dbgsym installed, because gdb can't find the symbol...

Steve Langasek (vorlon) wrote :

Here we go:

Breakpoint 1, gdk_x_error (display=0x221ebe0, error=0x7fff59879f00)
    at /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkmain-x11.c:438
438 /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkmain-x11.c: No such file or directory.
        in /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkmain-x11.c
(gdb) bt
#0 gdk_x_error (display=0x221ebe0, error=0x7fff59879f00)
    at /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkmain-x11.c:438
#1 0x00007f1f05f84091 in xkl_process_error () from /usr/lib/libxklavier.so.15
#2 0x00007f1f0f34b414 in _XError () from /usr/lib/libX11.so.6
#3 0x00007f1f0f35189c in ?? () from /usr/lib/libX11.so.6
#4 0x00007f1f0f351f40 in _XReply () from /usr/lib/libX11.so.6
#5 0x00007f1f0f345cd3 in XSync () from /usr/lib/libX11.so.6
#6 0x00007f1f0f345e8b in ?? () from /usr/lib/libX11.so.6
#7 0x00007f1f0a1b3b02 in gnome_rr_config_apply_with_time ()
   from /usr/lib/libgnome-desktop-2.so.11
#8 0x00007f1f0a3c5504 in ?? ()
   from /usr/lib/gnome-settings-daemon-2.0/libxrandr.so
#9 0x00007f1f12719474 in gdk_event_apply_filters (
    display=<value optimized out>, event=0x22decb0, xevent=0x7fff5987a3f0,
    return_exposes=<value optimized out>)
    at /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkevents-x11.c:351
#10 gdk_event_translate (display=<value optimized out>, event=0x22decb0,
    xevent=0x7fff5987a3f0, return_exposes=<value optimized out>)
    at /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkevents-x11.c:1025
#11 0x00007f1f1271a868 in _gdk_events_queue (display=0x222e000)
    at /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkevents-x11.c:2302
#12 0x00007f1f1271acae in gdk_event_dispatch (source=<value optimized out>,
    callback=0x7fff59879f00, user_data=0x0)
---Type <return> to continue, or q <return> to quit---
    at /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkevents-x11.c:2363
#13 0x00007f1f0fe04bbe in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#14 0x00007f1f0fe08588 in ?? () from /lib/libglib-2.0.so.0
#15 0x00007f1f0fe089e5 in g_main_loop_run () from /lib/libglib-2.0.so.0
#16 0x00007f1f12aa60e7 in IA__gtk_main ()
    at /build/buildd/gtk+2.0-2.18.2/gtk/gtkmain.c:1216
#17 0x00000000004046a5 in main ()

let me know if you need this rerun with more debugging symbols.

Chris Coulson (chrisccoulson) wrote :

Thanks Steve. Could you please re-run with the following extra symbol packages though: libx11-6-dbg libgnome-desktop-2-11-dbgsym libxrandr2-dbg libglib2.0-0-dbg

Thanks!

Changed in gnome-settings-daemon (Ubuntu):
assignee: nobody → Ubuntu Desktop Bugs (desktop-bugs)
importance: Undecided → Medium
status: New → Incomplete
Steve Langasek (vorlon) wrote :
Download full text (3.7 KiB)

Full backtrace:

Breakpoint 1, gdk_x_error (display=0x1fc5b80, error=0x7fff3ae82470)
    at /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkmain-x11.c:438
438 /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkmain-x11.c: No such file or directory.
        in /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkmain-x11.c
(gdb) bt
#0 gdk_x_error (display=0x1fc5b80, error=0x7fff3ae82470)
    at /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkmain-x11.c:438
#1 0x00007f3f31f1f091 in xkl_process_error () from /usr/lib/libxklavier.so.15
#2 0x00007f3f3b2e4414 in _XError (dpy=0x1fc5b80, rep=0x207e8d0)
    at ../../src/XlibInt.c:2924
#3 0x00007f3f3b2ea89c in process_responses (dpy=0x1fc5b80,
    wait_for_first_event=<value optimized out>,
    current_error=<value optimized out>, current_request=5159)
    at ../../src/xcb_io.c:207
#4 0x00007f3f3b2eaf40 in _XReply (dpy=0x1fc5b80, rep=0x7fff3ae82650, extra=0,
    discard=0) at ../../src/xcb_io.c:457
#5 0x00007f3f3a26825b in XRRSetCrtcConfig (dpy=0x1fc5b80,
    resources=0x20e0c00, crtc=58, timestamp=235837469, x=0,
    y=<value optimized out>, mode=67, rotation=1, outputs=0x20df040,
    noutputs=1) at ../../src/XrrCrtc.c:147
#6 0x00007f3f3614beb0 in gnome_rr_crtc_set_config_with_time (crtc=0x20de590,
    timestamp=837978568, x=<value optimized out>, y=<value optimized out>,
    mode=0x20deb10, rotation=<value optimized out>, outputs=0x2077250,
    n_outputs=1, error=0x7fff3ae82868) at gnome-rr.c:1279
#7 0x00007f3f3614e699 in configure_crtc (key=0x1fc5b80,
    value=<value optimized out>, data=0x7fff3ae827f0) at gnome-rr-config.c:1761
#8 0x00007f3f3bd8ed03 in IA__g_hash_table_foreach (hash_table=0x20e0800,
    func=0x7f3f3614e650 <configure_crtc>, user_data=0x7fff3ae827f0)
---Type <return> to continue, or q <return> to quit---
    at /build/buildd/glib2.0-2.22.2/glib/ghash.c:1211
#9 0x00007f3f3614eb2d in crtc_assignment_apply (config=<value optimized out>,
    screen=<value optimized out>, timestamp=<value optimized out>,
    error=0x7fff3ae82868) at gnome-rr-config.c:2045
#10 gnome_rr_config_apply_with_time (config=<value optimized out>,
    screen=<value optimized out>, timestamp=<value optimized out>,
    error=0x7fff3ae82868) at gnome-rr-config.c:1418
#11 0x00007f3f36360504 in ?? ()
   from /usr/lib/gnome-settings-daemon-2.0/libxrandr.so
#12 0x00007f3f3e6b2474 in gdk_event_apply_filters (
    display=<value optimized out>, event=0x207e590, xevent=0x7fff3ae82a80,
    return_exposes=<value optimized out>)
#13 gdk_event_translate (display=<value optimized out>, event=0x207e590,
    xevent=0x7fff3ae82a80, return_exposes=<value optimized out>)
    at /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkevents-x11.c:1025
#14 0x00007f3f3e6b3868 in _gdk_events_queue (display=0x1fd5000)
    at /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkevents-x11.c:2302
#15 0x00007f3f3e6b3cae in gdk_event_dispatch (source=<value optimized out>,
    callback=0x7fff3ae82470, user_data=0x0)
    at /build/buildd/gtk+2.0-2.18.2/gdk/x11/gdkevents-x11.c:2363
#16 0x00007f3f3bd9dbbe in g_main_dispatch (context=0x1fdeb00)
    at /build/buildd/glib2.0-2.22.2/glib/gmain.c:1960
---Type <return> to continue, or q <return> to qui...

Read more...

Changed in gnome-settings-daemon (Ubuntu):
status: Incomplete → Triaged
Steve Langasek (vorlon) on 2009-11-02
Changed in gnome-settings-daemon (Ubuntu Karmic):
status: New → Triaged
importance: Undecided → Medium
Steve Langasek (vorlon) wrote :

$ xtrace -D:9 -d:0 -k 2>&1 | tee ~/xtrace.log &
[1] 20412
$ killall gnome-settings-daemon
$ DISPLAY=:9.0 gnome-settings-daemon
<scroll>
Fn+F7
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 3208 error_code 8 request_code 149 minor_code 7)
  (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.)
000:>:c88:Error 8=Match: major=7, minor=149, bad=268
000:>:0c89:32: Reply to RandrSetCrtcConfig: status=InvalidTime(0x02)
$ kill %1
$

Log attached.

BTW, there's no need to enable TCP connections in gdm to do this. xtrace works just fine using Unix sockets, which is what the -d :0 specifies, after all.

Changed in gnome-settings-daemon (Ubuntu Karmic):
assignee: nobody → Chris Coulson (chrisccoulson)
Steve Langasek (vorlon) wrote :

(oh, and apologies for the extra randr commands in the log; I tapped Fn+F7 a few times before I noticed I hadn't plugged my VGA monitor in yet. ;)

Sebastian Geiger (lanoxx) wrote :

Since I am experiencing this bug too, please let me know if I can supply any more information. I am experiencing this bug almost every day now, so the more I can help the better.

Sebastian Geiger (lanoxx) wrote :

$gnome-settings-daemon

(gnome-settings-daemon:11407): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed

Chris Coulson (chrisccoulson) wrote :

lanoxx - sorry, I've just been so busy recently, but I'm going to spend some time on this one now :)

The error message there is actually an unrelated bug in gnome-desktop btw (bug 449380)

Chris Coulson (chrisccoulson) wrote :
Download full text (3.8 KiB)

The last few lines of the xtrace log show what is happening here at the protocol level:

000:<:0c81: 20: RANDR-Request(149,7): RandrSetScreenSize window=0x0000010c width=2640 height=800 width[mm]=699 height[mm]=212
000:<:0c82: 32: RANDR-Request(149,21): RandrSetCrtcConfig crtc=0x00000039 timestamp=0x1149c26e config timestamp=0x1149c26e x=1280 y=0 mode=0x00000223 rr=Rotate_0 outputs=0x0000003b;
000:>:0c82: Event RandrScreenChangeNotify(100) rotation=Rotate_0 timestamp=0x11498dd9 configTimestamp=0x1149c26e root=0x0000010c window=0x0000010c size-id=0xffff subpixelOrder=HorizontalRGB(0x0001) width[pixels]=2640 height[pixels]=800 width[mm]=699 height[mm]=212
000:>:0c82: Event ConfigureNotify(22) event=0x0000010c window=0x0000010c above-sibling=None(0x00000000) x=0 y=0 width=2640 height=800 border-width=0 override-redirect=false(0x00)
000:>:0c82: Event RandrScreenChangeNotify(100) rotation=Rotate_0 timestamp=0x11498dd9 configTimestamp=0x1149c26e root=0x0000010c window=0x0000010c size-id=0xffff subpixelOrder=HorizontalRGB(0x0001) width[pixels]=2640 height[pixels]=800 width[mm]=699 height[mm]=212
000:>:0c82: Event RandrChangeNotify1dot2(101) timestamp=0x11498dd9 request window=0x0000010c crtc affected=0x00000039 mode in use=0x00000223 new rr=Rotate_0 x=1280 y=0 width=1360 height=768
000:>:0c82: Event ConfigureNotify(22) event=0x0000010c window=0x0000010c above-sibling=None(0x00000000) x=0 y=0 width=2640 height=800 border-width=0 override-redirect=false(0x00)
000:>:0c82:32: Reply to RandrSetCrtcConfig: status=Success(0x00)
000:<:0c83: 32: RANDR-Request(149,21): RandrSetCrtcConfig crtc=0x0000003a timestamp=0x1149c26e config timestamp=0x1149c26e x=0 y=0 mode=0x0000003e rr=Rotate_0 outputs=0x0000003c;
000:>:0c83:32: Reply to RandrSetCrtcConfig: status=Success(0x00)
000:<:0c84: 12: RANDR-Request(149,30): RandrSetOutputPrimary window=0x0000010c output=0x00000000
000:<:0c85: 4: Request(37): UngrabServer
000:<:0c86: 4: Request(43): GetInputFocus
000:>:0c86:32: Reply to GetInputFocus: revert-to=Parent(0x02) focus=0x02a00004
***********************************
000:<:0c87: 4: Request(36): GrabServer
000:<:0c88: 20: RANDR-Request(149,7): RandrSetScreenSize window=0x0000010c width=1280 height=800 width[mm]=339 height[mm]=212
000:<:0c89: 32: RANDR-Request(149,21): RandrSetCrtcConfig crtc=0x00000039 timestamp=0x11499b3d config timestamp=0x1149c26e x=0 y=0 mode=0x0000003e rr=Rotate_0 outputs=0x0000003b;
000:>:c88:Error 8=Match: major=7, minor=149, bad=268

There seems to be 2 separate events here (probably triggered by pressing Fn+F7 twice).

The first event sets the screen size to 2640x800, with LVDS1 connected to CRTC 3a (positioned at x=0 and set to 1280x800), and VGA1 connected to CRTC 39 (which is positioned at x=1280 and set to 1360x768)

The second event sets the screen size back down to 1280x800, before repositioning CRTC 39 (with VGA1 connected to it) to x=0 and setting it to 1280x800. The issue here is that the screen size is set to 1280x800 whilst CRTC39 is still displaying to an area beyond that - and this makes RandrSetScreenSize throw a BadMatch error ("All active monitors must be configured to display a subset of the specified size, else a Matc...

Read more...

Chris Coulson (chrisccoulson) wrote :

Re-assigning this to gnome-desktop

affects: gnome-settings-daemon (Ubuntu Karmic) → gnome-desktop (Ubuntu Karmic)
Chris Coulson (chrisccoulson) wrote :

Hmmmm, I'm wondering if the second event is being received quickly enough so that it is dispatched before the ScreenInfo structure is updated with the new screen settings from the first event :-/

Chris Coulson (chrisccoulson) wrote :

Ok, there are a couple of keypresses in quick succession, and those events look like they are queued. In addition to that, it looks quite clear from the xtrace log that there is no update of the ScreenInfo structure between the last 2 events (so, ScreenInfo is out of date during the second event, which probably explains why CRTC39 is not switched off like it should be)

On Thu, Nov 12, 2009 at 03:14:00AM -0000, Chris Coulson wrote:
> There seems to be 2 separate events here (probably triggered by pressing
> Fn+F7 twice).

No, actually, I was careful to only press Fn+F7 once after plugging in the
VGA cable. (I probably pressed it a few times before that until I noticed I
/hadn't/ plugged in the VGA cable.) The crash happens reliably for me with
a single keypress.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

Steve Langasek (vorlon) wrote :

Here's a fresh xtrace.log. Same procedure as before, except I made sure to only press Fn+F7 once total (whereas before I had pressed it several times by mistake before connecting the VGA cable).

Procedure is:

- start xtrace
- set video output to LVDS
- disconnect VGA cable
- killall gnome-settings-daemon
- start gnome-settings-daemon with DISPLAY=:9.0
- connect VGA cable
- wait 5 seconds
- press Fn+F7
- crash

Martin Pitt (pitti) wrote :

Still confirmed by Steve on current Lucid.

tnhh (tnhh) wrote :

I am seeing this on Maverick whenever I connect or disconnect my laptop from an external display.

Confirming on Maverick. Radeon 5750.

Tested with the Maverick desktop installation media via thumbdrive and it crashes in the installer as well.

Ville Ranki (ville-ranki) wrote :

I'm getting this or similiar error on Mint Nadia. On every login gtk theme "crashes" and .xsession-error contains:

(gnome-settings-daemon:1878): 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 770 error_code 8 request_code 131 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 GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
gnome-session[1779]: WARNING: Application 'gnome-settings-daemon.desktop' killed by signal 5

Adolfo Jayme (fitojb) on 2014-10-18
no longer affects: gnome-desktop (Ubuntu Karmic)
no longer affects: gnome-desktop (Ubuntu Lucid)
Changed in gnome-desktop (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers