Bug 608402

Summary: The program 'gnome-power-manager' received an X Window System error.
Product: [Fedora] Fedora Reporter: ritz <rkhadgar>
Component: gnome-power-managerAssignee: Richard Hughes <richard>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: genes1122, mike, rhughes, richard
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: gnome-power-manager-2.31.90-3.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-23 21:55:29 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Attachments:
Description Flags
output of 'bt full'
none
gnome-power-bugreport.sh output
none
gnome-power-manager-2.31.6-backlight-is-None.patch none

Description ritz 2010-06-27 06:29:54 EDT
Description of problem:
gpm crashes on startup

Version-Release number of selected component (if applicable):
gnome-power-manager-2.31.3-1.fc14.x86_64

How reproducible:
always


Additional info:
$ gnome-power-bugreport.sh 
Distro version:       Fedora release 14 (Rawhide)
Kernel version:       2.6.34-45.fc14.x86_64
g-p-m version:        2.31.3
HAL version:          0.5.14
System manufacturer:  missing
System version:       missing
System product:       missing
AC adapter present:   yes
Battery present:      yes
Laptop panel present: yes
CPU scaling present:  no

bt -
Gtk-Message: Failed to load module "pk-gtk-module": libpk-gtk-module.so: cannot open shared object file: No such file or directory
[New Thread 0x7ffff0a6f710 (LWP 2477)]

(gnome-power-manager:2474): GLib-GObject-WARNING **: gsignal.c:2276: signal `proxy-status' is invalid for instance `0x6b7260'
Detaching after fork from child process 2479.
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 171 error_code 5 request_code 148 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.)

(gdb) bt
#0  0x00000030646aa420 in _exit () from /lib64/libc.so.6
#1  0x0000003064636f52 in exit () from /lib64/libc.so.6
#2  0x00000037df867fcf in ?? () from /usr/lib64/libgdk-x11-3.0.so.0
#3  0x0000003067e46da4 in _XError () from /usr/lib64/libX11.so.6
#4  0x0000003067e4d277 in ?? () from /usr/lib64/libX11.so.6
#5  0x0000003067e4d983 in _XReply () from /usr/lib64/libX11.so.6
#6  0x000000306aa051bc in XRRGetOutputProperty () from /usr/lib64/libXrandr.so.2
#7  0x0000000000419e0a in ?? ()
#8  0x000000000041a330 in ?? ()
#9  0x000000000041aa4a in ?? ()
#10 0x0000000000409ba9 in ?? ()
#11 0x00007ffff7873915 in g_type_create_instance (type=<value optimized out>) at gtype.c:1888
#12 0x00007ffff785669c in g_object_constructor (type=<value optimized out>, n_construct_properties=0, construct_params=0x0)
    at gobject.c:1483
#13 0x00007ffff785796a in g_object_newv (object_type=7159312, n_parameters=0, parameters=0x0) at gobject.c:1267
#14 0x00007ffff785819c in g_object_new (object_type=7159312, first_property_name=0x0) at gobject.c:1179
#15 0x000000000040d912 in ?? ()
#16 0x00007ffff7873915 in g_type_create_instance (type=<value optimized out>) at gtype.c:1888
#17 0x00007ffff785669c in g_object_constructor (type=<value optimized out>, n_construct_properties=0, construct_params=0x0)
    at gobject.c:1483
#18 0x00007ffff785796a in g_object_newv (object_type=7025504, n_parameters=0, parameters=0x0) at gobject.c:1267
#19 0x00007ffff785819c in g_object_new (object_type=7025504, first_property_name=0x0) at gobject.c:1179
#20 0x000000000040d312 in ?? ()
#21 0x000000000040ce7c in ?? ()
#22 0x000000306461ed6d in __libc_start_main () from /lib64/libc.so.6
Comment 1 Richard Hughes 2010-06-27 08:42:19 EDT
Your backtrace is meanlingless. You need to install the debuginfo packages.
Comment 2 ritz 2010-07-13 04:28:52 EDT
Breakpoint 1, 0x0000003b500aa260 in _exit () from /lib64/libc.so.6
(gdb) bt
#0  0x0000003b500aa260 in _exit () from /lib64/libc.so.6
#1  0x0000003b50036f12 in exit () from /lib64/libc.so.6
#2  0x0000003423c65cff in ?? () from /usr/lib64/libgdk-x11-3.0.so.0
#3  0x0000003b53c46da4 in _XError () from /usr/lib64/libX11.so.6
#4  0x0000003b53c4d277 in ?? () from /usr/lib64/libX11.so.6
#5  0x0000003b53c4d983 in _XReply () from /usr/lib64/libX11.so.6
#6  0x0000003b584051bc in XRRGetOutputProperty ()
   from /usr/lib64/libXrandr.so.2
#7  0x000000000041c25a in gpm_brightness_output_get_internal (brightness=
    0x6d5180, output=81, cur=0x7fffffffd644) at gpm-brightness.c:178
#8  0x000000000041c780 in gpm_brightness_output_get_percentage (brightness=
    0x6d5180, op=<value optimized out>) at gpm-brightness.c:323
#9  gpm_brightness_foreach_resource (brightness=0x6d5180, 
    op=<value optimized out>) at gpm-brightness.c:489
#10 gpm_brightness_foreach_screen (brightness=0x6d5180, 
    op=<value optimized out>) at gpm-brightness.c:526
#11 0x000000000041ce9a in gpm_brightness_get (brightness=0x6d5180, percentage=
    0x7fffffffd6d4) at gpm-brightness.c:633
#12 0x000000000040c349 in gpm_backlight_brightness_evaluate_and_set (backlight=
    0x665a80, interactive=0) at gpm-backlight.c:342
#13 0x0000003b52430915 in g_type_create_instance ()
   from /lib64/libgobject-2.0.so.0
#14 0x0000003b5241369c in ?? () from /lib64/libgobject-2.0.so.0
---Type <return> to continue, or q <return> to quit---fram 7
#15 0x0000003b5241496a in g_object_newv () from /lib64/libgobject-2.0.so.0
#16 0x0000003b5241519c in g_object_new () from /lib64/libgobject-2.0.so.0
#17 0x000000000041033b in gpm_manager_init (manager=0x673440)
    at gpm-manager.c:1985
#18 0x0000003b52430915 in g_type_create_instance ()
   from /lib64/libgobject-2.0.so.0
#19 0x0000003b5241369c in ?? () from /lib64/libgobject-2.0.so.0
#20 0x0000003b5241496a in g_object_newv () from /lib64/libgobject-2.0.so.0
#21 0x0000003b5241519c in g_object_new () from /lib64/libgobject-2.0.so.0
#22 0x000000000040fa82 in gpm_manager_new () at gpm-manager.c:2104
#23 0x000000000040f5ec in main (argc=1, argv=0x7fffffffe208) at gpm-main.c:248
(gdb) fram 7
#7  0x000000000041c25a in gpm_brightness_output_get_internal (brightness=
    0x6d5180, output=81, cur=0x7fffffffd644) at gpm-brightness.c:178
178		if (XRRGetOutputProperty (brightness->priv->dpy, output, brightness->priv->backlight,
(gdb) list
173		int actual_format;
174		gboolean ret = FALSE;
175	
176		g_return_val_if_fail (GPM_IS_BRIGHTNESS (brightness), FALSE);
177	
178		if (XRRGetOutputProperty (brightness->priv->dpy, output, brightness->priv->backlight,
179					  0, 4, False, False, None,
180					  &actual_type, &actual_format,
181					  &nitems, &bytes_after, ((unsigned char **)&prop)) != Success) {
182			egg_debug ("failed to get property");
(gdb) p *brightness
$1 = {parent = {g_type_instance = {g_class = 0x69ac70}, ref_count = 1, qdata = 
    0x7fffec0018a0}, priv = 0x6d51a0}
(gdb) p *(brightness->priv)
$2 = {has_changed_events = 0, cache_trusted = 0, cache_percentage = 0, 
  last_set_hw = 0, backlight = 0, dpy = 0x653e00, root_window = 0x669030, 
  shared_value = 0, has_extension = 0, has_randr13 = 1, hw_changed = 0, 
  resources = 0x7fffec001900, extension_levels = 10, extension_current = 0}
(gdb) p *(brightness->priv->dpy)
$3 = <incomplete type>
(gdb) p *(brightness->priv->backlight)
Cannot access memory at address 0x0
Comment 3 Bug Zapper 2010-07-30 08:15:38 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 4 Will Woods 2010-08-14 01:42:44 EDT
Created attachment 438783 [details]
output of 'bt full'

Reproducible here (New 13" Macbook Pro [7,1]). Backtrace goes through gpm_brightness_output_get_internal in about the same way.
Comment 5 Will Woods 2010-08-14 01:45:47 EDT
Created attachment 438784 [details]
gnome-power-bugreport.sh output
Comment 6 Will Woods 2010-08-15 20:19:45 EDT
Created attachment 438871 [details]
gnome-power-manager-2.31.6-backlight-is-None.patch

The problem (at least for my machine) is that some part of the system (upower? kernel? who knows) doesn't know how to deal with the backlight brightness. So gpm_backlight_init does:
  backlight->priv->brightness = gpm_brightness_new ();
which sets backlight->priv->brightness to 0 (i.e. None). So when we get to gpm_backlight_brightness_evaluate_and_set(), we end up trying to read the X property for something that's None, and X barfs at us, and gpm crashes.

Okay. So. Adding a nice simple check to gpm_brightness_output_get_internal():

        if (brightness->priv->backlight == None)
                return FALSE;

lets gpm at least start up and run without crashing. Brightness control obviously isn't working, and it doesn't think I have a lid on my laptop, but at least we're not crashing.
Comment 7 Fedora Update System 2010-08-23 15:20:54 EDT
gnome-power-manager-2.31.90-3.fc14 has been submitted as an update for Fedora 14.
http://admin.fedoraproject.org/updates/gnome-power-manager-2.31.90-3.fc14
Comment 8 Matthias Clasen 2010-08-23 15:23:31 EDT
*** Bug 607008 has been marked as a duplicate of this bug. ***
Comment 9 Fedora Update System 2010-08-23 21:55:17 EDT
gnome-power-manager-2.31.90-3.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 10 Will Woods 2010-08-24 17:38:51 EDT
*** Bug 621596 has been marked as a duplicate of this bug. ***