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 627711 - gnome-power-manager crashed with signal 5 in _XError on systems without XBACKLIGHT
gnome-power-manager crashed with signal 5 in _XError on systems without XBACK...
Status: RESOLVED FIXED
Product: gnome-power-manager
Classification: Deprecated
Component: general
2.31.x
Other Linux
: Normal critical
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-08-23 11:09 UTC by Chris Coulson
Modified: 2010-09-29 03:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Fix-627711-Don-t-crash-on-systems-which-don-t-have-X.patch (856 bytes, patch)
2010-08-23 11:11 UTC, Chris Coulson
none Details | Review
patch for this issue, written by Will Woods (666 bytes, patch)
2010-08-23 17:26 UTC, Matthias Clasen
none Details | Review
Guard all X calls for priv->backlight (1.28 KB, patch)
2010-08-23 18:50 UTC, Michael Terry
none Details | Review

Description Chris Coulson 2010-08-23 11:09:28 UTC
gnome-power-manager crashes due to an unhandled X error on systems without XBACKLIGHT:

Gdk-ERROR **: The program 'gnome-power-manager' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAtom (invalid Atom parameter)'.
  (Details: serial 160 error_code 5 request_code 150 minor_code 15)
  (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.)
aborting...
Trace/breakpoint trap (core dumped)

  • #0 g_logv
    at /build/buildd/glib2.0-2.25.14/glib/gmessages.c line 554
  • #1 g_log
    at /build/buildd/glib2.0-2.25.14/glib/gmessages.c line 568
  • #2 gdk_x_error
    at /build/buildd/gtk+2.0-2.21.6/gdk/x11/gdkmain-x11.c line 466
  • #3 _XError
    at ../../src/XlibInt.c line 3103
  • #4 _XReply
    at ../../src/xcb_io.c line 513
  • #5 XRRGetOutputProperty
    at ../../src/XrrProperty.c line 271
  • #6 gpm_brightness_output_get_internal
    at gpm-brightness.c line 179
  • #7 gpm_brightness_output_get_percentage
    at gpm-brightness.c line 324
  • #8 gpm_brightness_foreach_resource
    at gpm-brightness.c line 490
  • #9 gpm_brightness_foreach_screen
    at gpm-brightness.c line 527
  • #10 gpm_brightness_get
    at gpm-brightness.c line 634
  • #11 gpm_backlight_brightness_evaluate_and_set
    at gpm-backlight.c line 355
  • #12 gpm_backlight_init
    at gpm-backlight.c line 844
  • #13 g_type_create_instance
    at /build/buildd/glib2.0-2.25.14/gobject/gtype.c line 1887
  • #14 g_object_constructor
    at /build/buildd/glib2.0-2.25.14/gobject/gobject.c line 1482
  • #15 g_object_newv
    at /build/buildd/glib2.0-2.25.14/gobject/gobject.c line 1266
  • #16 g_object_new
    at /build/buildd/glib2.0-2.25.14/gobject/gobject.c line 1178
  • #17 gpm_manager_init
    at gpm-manager.c line 1983
  • #18 g_type_create_instance
    at /build/buildd/glib2.0-2.25.14/gobject/gtype.c line 1887
  • #19 g_object_constructor
    at /build/buildd/glib2.0-2.25.14/gobject/gobject.c line 1482
  • #20 g_object_newv
    at /build/buildd/glib2.0-2.25.14/gobject/gobject.c line 1266
  • #21 g_object_new
    at /build/buildd/glib2.0-2.25.14/gobject/gobject.c line 1178
  • #22 gpm_manager_new
    at gpm-manager.c line 2104
  • #23 main
    at gpm-main.c line 247
        session = 0x6c0b70
        manager = <value optimized out>
        error = 0x0
        context = 0x637320
        ret = <value optimized out>
        options = {{long_name = 0x4214e0 "verbose", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffe16c, description = 0x421648 "Show extra debugging information", arg_description = 0x0}, {long_name = 0x4214e8 "version", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, 
            arg_data = 0x7fffffffe168, description = 0x421670 "Show version of installed program and exit", arg_description = 0x0}, {long_name = 0x4214f0 "timed-exit", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffe164, 
            description = 0x4216a0 "Exit after a small delay (for debugging)", arg_description = 0x0}, {long_name = 0x4214fb "immediate-exit", short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x7fffffffe160, description = 0x4216d0 "Exit after the manager has loaded (for debugging)", 
            arg_description = 0x0}, {long_name = 0x0, short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x0, description = 0x0, arg_description = 0x0}}
        __FUNCTION__ = "main"

This happens on 2.31.90. It looks like the same bug affects master too
Comment 1 Chris Coulson 2010-08-23 11:11:57 UTC
Created attachment 168554 [details] [review]
0001-Fix-627711-Don-t-crash-on-systems-which-don-t-have-X.patch

Here is a patch which fixes this
Comment 2 Chris Coulson 2010-08-23 11:16:57 UTC
Note that people experiencing this see "no XRANDR extension" when running gnome-power-manager --verbose

Here is the downstream bug report: https://launchpad.net/bugs/614039
Comment 3 Matthias Clasen 2010-08-23 17:25:32 UTC
The same BadAtom can hit people who have the xrandr extension, but xbacklight is nonfunctional and returns None for the property name.
Comment 4 Matthias Clasen 2010-08-23 17:26:56 UTC
Created attachment 168574 [details] [review]
patch for this issue, written by Will Woods
Comment 5 Michael Terry 2010-08-23 18:50:16 UTC
Created attachment 168580 [details] [review]
Guard all X calls for priv->backlight

Chris's patch did two things that Will's doesn't:
 1) Guarded output_set_internal and output_get_limits, both of which also have this problem
 2) Avoided the XSync at the end of foreach_screen

But if you still like Will's patch, here's at least an updated one that adds checks for set_internal and get_limits.  You can still avoid the reported crash without these, but seems like they should be guarded too.
Comment 6 Richard Hughes 2010-08-25 01:50:30 UTC
Michael, please apply your patch. I'm away from my laptop at the moment. Thanks.
Comment 7 Matthias Clasen 2010-09-29 03:36:59 UTC
This was committed a while ago