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 571006 - GNOME Power Manager hangs on brightness adjust
GNOME Power Manager hangs on brightness adjust
Status: RESOLVED OBSOLETE
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
2.24.x
Other All
: Normal critical
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-02-09 00:21 UTC by Richard Schwarting
Modified: 2012-03-23 09:44 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24



Description Richard Schwarting 2009-02-09 00:21:30 UTC
Steps to reproduce:
1. on at least my HP tx2000, remove the power cord
2. note that the brightness change box appears
3. note that it freezes and that GPM is frozen


Stack trace:
  • #0 nanosleep
    from /lib64/libpthread.so.0
  • #1 IA__g_usleep
    at gtimer.c line 170
  • #2 gpm_brightness_xrandr_output_set
    at gpm-brightness-xrandr.c line 354
  • #3 gpm_brightness_xrandr_foreach_resource
    at gpm-brightness-xrandr.c line 384
  • #4 gpm_brightness_xrandr_foreach_screen
    at gpm-brightness-xrandr.c line 415
  • #5 gpm_brightness_xrandr_set
    at gpm-brightness-xrandr.c line 443
  • #6 gpm_brightness_set
    at gpm-brightness.c line 133
  • #7 gpm_backlight_brightness_evaluate_and_set
    at gpm-backlight.c line 453
  • #8 IA__g_closure_invoke
    at gclosure.c line 767
  • #9 signal_emit_unlocked_R
    at gsignal.c line 3244
  • #10 IA__g_signal_emit_valist
    at gsignal.c line 2977
  • #11 IA__g_signal_emit
    at gsignal.c line 3034
  • #12 IA__g_closure_invoke
    at gclosure.c line 767
  • #13 signal_emit_unlocked_R
    at gsignal.c line 3244
  • #14 IA__g_signal_emit_valist
    at gsignal.c line 2977
  • #15 IA__g_signal_emit
    at gsignal.c line 3034
  • #16 watch_device_property_modified
    at libhal-gdevice.c line 311
  • #17 watch_device_properties_modified_cb
    at libhal-gdevice.c line 359
  • #18 marshal_dbus_message_to_g_marshaller
    at dbus-gproxy.c line 1672
  • #19 IA__g_closure_invoke
    at gclosure.c line 767
  • #20 signal_emit_unlocked_R
    at gsignal.c line 3244
  • #21 IA__g_signal_emit_valist
    at gsignal.c line 2977
  • #22 IA__g_signal_emit
    at gsignal.c line 3034
  • #23 dbus_g_proxy_emit_remote_signal
    at dbus-gproxy.c line 1725
  • #24 dbus_g_proxy_manager_filter
    at dbus-gproxy.c line 1293
  • #25 dbus_connection_dispatch
    at dbus-connection.c line 4406
  • #26 message_queue_dispatch
    at dbus-gmain.c line 101
  • #27 g_main_dispatch
    at gmain.c line 2144
  • #28 IA__g_main_context_dispatch
    at gmain.c line 2697
  • #29 g_main_context_iterate
    at gmain.c line 2778
  • #30 IA__g_main_loop_run
    at gmain.c line 2986
  • #31 main
    at gpm-main.c line 245




Other information:
This is because we get a bogus value for the current brightness from X on this hardware, and there's no handling for such cases in GPM. We try decreasing from the current brightness value of 40610610 (!) to 127, with a sleep in between, making this loop go on effectively for ever. 

gpm_backlight_brightness_evaluate_and_set(), which calls
gpm_brightness_set(), which calls
gpm_brightness_xrandr_set(), which calls
gpm_brightness_xrandr_foreach_screen(), which calls
gpm_brightness_xrandr_foreach_resource()


gpm_brightness_xrandr_foreach_resource()  calls
gpm_brightness_xrandr_output_get_internal(), which returns cur (current brightness?) which is ***totally broken on this hardware (40610610)***.
(gpm_brightness_xrandr_output_get_internal() had made calls to XRRGetOutputProperty() in a loop.
The first call did not succeed, but the second "does", but the value it gets for prop from _XRead32() (which adjusts 40612122 from _XRead() > "memcpy()" is an int*))

Then, gpm_brightness_xrandr_foreach_resource() calls
gpm_brightness_xrandr_output_set(), 
where, with cur=40610610, shared_value_abs = 127
348			for (i=cur; i>=shared_value_abs; i--) {
349				ret = gpm_brightness_xrandr_output_set_internal (brightness, output, i);
(gdb) l
350				if (!ret) {
351					break;
352				}
353				if (cur != shared_value_abs) {
354					g_usleep (1000 * GPM_BRIGHTNESS_DIM_INTERVAL);
355				}
356			}

Which, as you can see, going down from 40610610 with that sleep in there basically leaves GNOME Power Manager frozen indefinitely.  

I'm not sure if it matters, but this is on a 64-bit AMD Turion x2 processor with 64-bit Fedora 10.

Yay.
Comment 1 Richard Hughes 2009-02-09 13:36:51 UTC
I agree it's a bug we don't do the sensible thing here, but isn't the root problem an X bug?