After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 661000 - gnome-settings-daemon crashes when started in NX session
gnome-settings-daemon crashes when started in NX session
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: power
3.2.x
Other Linux
: Normal critical
: ---
Assigned To: Richard Hughes
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2011-10-05 17:32 UTC by Pedro Villavicencio
Modified: 2011-10-10 13:55 UTC
See Also:
GNOME target: ---
GNOME version: 3.1/3.2


Attachments
test patch (2.15 KB, patch)
2011-10-07 09:36 UTC, Richard Hughes
needs-work Details | Review

Description Pedro Villavicencio 2011-10-05 17:32:48 UTC
this report has been filed here:

https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/867631

"nome-settings-daemon crashes when started in NX session.

(gnome-settings-daemon:20586): Gdk-WARNING **: The program 'gnome-settings-daemon' received an X Window System error.
This probably reflects a bug in the program.
The error was 'XSyncBadCounter'.
  (Details: serial 195 error_code 146 request_code 137 minor_code 5)
  (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 crashes because NX doesn't have an IDLETIME counter, and g-s-d just assumes the availability of it, despite this warning:

(gnome-settings-daemon:19148): power-plugin-WARNING **: No idle counter
"

"Note, minor code 5 is XSyncQueryCounter, so this is a crash in gpm_idletime_get_time
"
Comment 1 Richard Hughes 2011-10-05 18:55:10 UTC
I can't run NX, so a patch to fix this would be very welcome.

I imagine it's just a case of surrounding the code that crashes with:

    gdk_error_trap_push ();
    /* DPMSSetTimeouts() return value is often a lie, so ignore it */
    DPMSSetTimeouts (screen->priv->xdisplay, 0, 0, 0);
    if (gdk_error_trap_pop ()) {
        do_something_sane();
    }

Thanks.
Comment 2 Chris Coulson 2011-10-05 19:25:49 UTC
I can't run NX either, but I could probably still fix this when I get back from vacation next week if nobody else does, and ask one of the original reporters to test it.
Comment 3 Shelby Cain 2011-10-06 15:57:01 UTC
I'm the original reporter.  Based on the comment about gpm_idletime_get_time, I tracked down and commented out the call to gpm_idletime_get_time in idle_set_timeout_dim.  I then rebuilt the Ubuntu package and installed it to validate and the problem appears to have gone away.

Now, if one of you wanted to give me a general idea of how this should really be fixed and point me at the right source files I might be able to find some time this weekend to come up with a patch.
Comment 4 Shelby Cain 2011-10-06 16:08:56 UTC
Actually, I apologize - I have several open bug reports and didn't realize I'm not the original reporter for https://bugs.launchpad.net/gnome-settings-daemon/+bug/867631
Comment 5 Richard Hughes 2011-10-07 09:36:31 UTC
Created attachment 198515 [details] [review]
test patch

Can you test this patch please. Thanks.
Comment 6 Bastien Nocera 2011-10-07 10:08:00 UTC
Review of attachment 198515 [details] [review]:

You're missing a call to XQueryExtension() when creating the counter.
Comment 7 Shelby Cain 2011-10-07 19:13:37 UTC
(In reply to comment #5)
> Created an attachment (id=198515) [details] [review]
> test patch
> 
> Can you test this patch please. Thanks.

Patch applies cleanly to gnome-settings-daemon_3.2.0-0ubuntu5 and appears to resolve the issue.
Comment 8 Richard Hughes 2011-10-10 12:57:31 UTC
(In reply to comment #7)
> Patch applies cleanly to gnome-settings-daemon_3.2.0-0ubuntu5 and appears to
> resolve the issue.

Thanks for testing, I've pushed the patch to gnome-3-2 and master.
Comment 9 Shelby Cain 2011-10-10 13:55:37 UTC
Sure, no problem.  Glad to know I could help out.