The program 'gnome-settings-daemon' received an X Window System error. During on a FreeNX server suring a session. The crash does not happen when xrandr plugin is disabled.

Bug #454487 reported by mabawsa
98
This bug affects 15 people
Affects Status Importance Assigned to Milestone
FreeNX Server
Invalid
Undecided
Unassigned
gnome-desktop
Invalid
Medium
gnome-desktop (Ubuntu)
Fix Released
Medium
Chris Coulson
Karmic
Fix Released
Medium
Chris Coulson

Bug Description

I just installed karmic on my freenx server machine when g-s-d starts it throws the following error:
gnome-settings-daemon Xlib: extension "Generic Event Extension" missing on display ":1000.0".
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
The program 'gnome-settings-daemon' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadRequest (invalid request code or no such operation)'.
  (Details: serial 105 error_code 1 request_code 150 minor_code 8)
  (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.)

If I disable the xrandr plugin then the bug is not present (once bug 409621 is fixed).
This is a regression from Jaunty where the xrandr plugin worked.
I attach the the stack trace. If there is anything else I can do please let me know.

ProblemType: Bug
Architecture: amd64
Date: Sun Oct 18 17:10:18 2009
DistroRelease: Ubuntu 9.10
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Beta amd64 (20090929.2)
NonfreeKernelModules: nvidia
Package: libxrandr2 2:1.3.0-2
ProcEnviron:
 LANGUAGE=en_GB:en
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-14.48-generic
SourcePackage: libxrandr
Uname: Linux 2.6.31-14-generic x86_64

*** SRU stuff ***

Patch: http://launchpadlibrarian.net/34736555/gnome-desktop_2.28.1-0ubuntu3.debdiff

[Justification]
gnome-settings-daemon crashes at startup on X servers which don't support RANDR 1.2. This is a regression from Jaunty

[Description of patch]
The patch just traps the BadRequest error generated from the unsupported X call in gnome-desktop, and sets a GError, allowing the calling application to handle it.

[Test case]
Run gnome-settings-daemon with each version of gnome-desktop.

With gnome-desktop 2.28.1-0ubuntu2 - gnome-settings-daemon will crash
With gnome-desktop 2.28.1-0ubuntu3 - gnome-settings-daemon will not crash

[Regression risk]
The regression risk is low, because:

- gnome_rr_screen_new will now return a NULL GnomeRRScreen pointer and set a GError when called on servers that don't have RANDR 1.2 (as opposed to crashing). There are already other failure conditions in gnome_rr_screen_new which will return the same result, so this does not break API, and applications using it already handle the error properly (in the case of gnome-settings-daemon, the xrandr plugin just stops loading).

- This technique for trapping errors was used previously. There were XRR calls in the Jaunty code which were only supported on RANDR >= 1.2. These were wrapped with gdk_error_trap_{push,pop} in Jaunty, but it seems this got omitted when the code was changed this cycle.

Revision history for this message
mabawsa (mabawsa) wrote :
Bryce Harrington (bryce)
tags: added: crash
Revision history for this message
Erik Reuter (misc71) wrote :

I can confirm this behavior. I just upgraded my system from jaunty to karmic, and I found that gnome-settings-daemon would not start when running a free-nx session. However, g-s-d started properly when I started a normal gnome session (no free-nx). Then I disabled the xrandr plug-in, and g-s-d was able to start in a free-nx session.

Revision history for this message
Shanmuhanathan T (shanmuha) wrote :

I can also confirm this behaviour - once I disabled xrandr plugin for gnome_settings_daemon, freenx session started rendering properly (with appropriate themes, icons etc). This is in karmic.

Erik Reuter (misc71)
Changed in libxrandr (Ubuntu):
status: New → Confirmed
Changed in gnome-settings-daemon:
status: New → Confirmed
Changed in freenx-server:
status: New → Confirmed
Changed in freenx-server:
status: Confirmed → Invalid
affects: libxrandr (Ubuntu) → gnome-settings-daemon (Ubuntu)
Changed in gnome-settings-daemon (Ubuntu):
assignee: nobody → Ubuntu Desktop Bugs (desktop-bugs)
importance: Undecided → Medium
Changed in gnome-settings-daemon:
status: Confirmed → New
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

The error here is that XRRGetScreenResources fails with a BadRequest error. The only reason this should happen is if the server doesn't support version 1.2 of RANDR. I'll try adding a run-time check in gnome-desktop for this and ask someone to test it

affects: gnome-settings-daemon (Ubuntu) → gnome-desktop (Ubuntu)
Changed in gnome-desktop (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → Chris Coulson (chrisccoulson)
Changed in gnome-settings-daemon:
status: New → Invalid
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Indeed, that is the most likely culprit here. This didn't crash in Jaunty because it wrapped the unsupported call with gdk_error_trap_push and gdk_error_trap_pop to catch the error. That doesn't happen anymore in the new version (and it uses a different, but still unsupported call)

Changed in gnome-desktop (Ubuntu):
status: Confirmed → In Progress
Changed in gnome-desktop (Ubuntu Karmic):
milestone: none → karmic-updates
tags: added: regression-release
Revision history for this message
Gary (gary-baker) wrote :

can someone say how to go about disabling xrandr?

Revision history for this message
mabawsa (mabawsa) wrote :

In the terminal:

:~$gconf-editor

In gconf-editor

>apps>gnome-settings-daemon>plugins>xrandr

uncheck active

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Here's a debdiff for this one

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

IRC discussion from #ubuntu-desktop about this SRU:

[15:03] <chrisccoulson> pitti - is bug 454487 ok for a SRU?
[15:03] <ubottu> Launchpad bug 454487 in gnome-desktop "The program 'gnome-settings-daemon' received an X Window System error. During on a FreeNX server suring a session. The crash does not happen when xrandr plugin is disabled." [Medium,In progress] https://launchpad.net/bugs/454487
[15:03] <chrisccoulson> stgraber has already tested the patch and confirms it works
[15:03] <chrisccoulson> (the patch is in my PPA currently, but i will prepare a debdiff later)
[15:06] <seb128> chrisccoulson, seems a good sru candidate indeed
[15:06] <chrisccoulson> cool, thanks!
[15:07] <pitti> chrisccoulson: sounds fine; how intrusive is it?
[15:07] <pitti> chrisccoulson: i. e. regression potential for normal local usage?
[15:07] <chrisccoulson> pitti - the patch is here: http://launchpadlibrarian.net/34294574/gnome-desktop_1%3A2.28.1-0ubuntu2_1%3A2.28.1-0ubuntu3~chrisccoulson1.diff.gz
[15:08] <chrisccoulson> it just traps X errors when calling XRRGetScreenResources
[15:08] <chrisccoulson> under these circumstances, the xrandr plugin would be disabled
[15:09] <pitti> chrisccoulson: seems fine

description: updated
description: updated
description: updated
Revision history for this message
Chris Coulson (chrisccoulson) wrote :
description: updated
affects: gnome-settings-daemon → gnome-desktop
Changed in gnome-desktop:
importance: Undecided → Unknown
status: Invalid → Unknown
Changed in gnome-desktop (Ubuntu Karmic):
status: In Progress → Triaged
Changed in gnome-desktop (Ubuntu):
status: In Progress → Triaged
Revision history for this message
mabawsa (mabawsa) wrote :

I tried the gnome-desktop in your ppa and it appears to fix the problem. First time I nx'd in I got a white screen but that was probably a compiz thing.

Thanks for all your work again.

Changed in gnome-desktop (Ubuntu Karmic):
status: Triaged → Fix Committed
Changed in gnome-desktop (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted gnome-desktop into karmic-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in gnome-desktop (Ubuntu):
milestone: karmic-updates → lucid-alpha-1
tags: added: verification-needed
Revision history for this message
Stéphane Graber (stgraber) wrote :

I can confirm that the fix works correctly for me.
Thanks

Revision history for this message
Simon Déziel (sdeziel) wrote :

I can also confirm that the fix works.

Thanks

Revision history for this message
Bruno Lambert (bruno.lambert) wrote :

I confirm this fix works for me too, Thanks a lot.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-desktop - 1:2.28.1-0ubuntu3

---------------
gnome-desktop (1:2.28.1-0ubuntu3) karmic-proposed; urgency=low

  * debian/patches/101_trap_rr_x_errors.patch:
    - XRRGetScreenResources is only available on RANDR 1.2 and above.
      Trap and handle the BadRequest error when called on servers which
      don't implement this call, instead of crashing (LP: #454487)

 -- Chris Coulson <email address hidden> Fri, 23 Oct 2009 23:23:56 +0100

Changed in gnome-desktop (Ubuntu Karmic):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

Copied to lucid.

Changed in gnome-desktop (Ubuntu Karmic):
status: Fix Released → Fix Committed
Changed in gnome-desktop (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-desktop - 1:2.28.1-0ubuntu3

---------------
gnome-desktop (1:2.28.1-0ubuntu3) karmic-proposed; urgency=low

  * debian/patches/101_trap_rr_x_errors.patch:
    - XRRGetScreenResources is only available on RANDR 1.2 and above.
      Trap and handle the BadRequest error when called on servers which
      don't implement this call, instead of crashing (LP: #454487)

 -- Chris Coulson <email address hidden> Fri, 23 Oct 2009 23:23:56 +0100

Changed in gnome-desktop (Ubuntu Karmic):
status: Fix Committed → Fix Released
Changed in gnome-desktop:
importance: Unknown → Medium
Changed in gnome-desktop:
status: Unknown → Invalid
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.