[regression] on-AC backlight brightness always used on-battery ignored (hal-addon-acpi crashes)

Bug #148467 reported by Paul Sladen
2
Affects Status Importance Assigned to Milestone
gnome-power
Fix Released
Medium
gnome-power-manager (Ubuntu)
Invalid
Undecided
Unassigned
hal (Ubuntu)
Fix Released
Undecided
Paul Sladen

Bug Description

Binary package hint: gnome-power-manager

Gnome power applet->Right click->Preferences.

The applet correctly shows "battery discharging" state icon, but the "Set display brightness to" slider for AC setting is being used). Moving this AC slider setting changes brightness on battery.

Ideally the AC setting would be used on AC, and the Battery brightness setting used on-battery.

Related branches

Revision history for this message
Paul Sladen (sladen) wrote : Re: [regression] on-AC backlight brightness always used on-battery ignored
Download full text (3.7 KiB)

<sladen> acpi is seeing 'ac_adapter' events; hal isn't reporting them
<sladen> ah ha. hal-addon-acpi does get started with hal restart, but the first acpi event kills hal-addon-acpi

Useless backtrace:

(gdb) bt
#0 0xffffe410 in __kernel_vsyscall ()
#1 0xb7dfa875 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb7dfc201 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0xb7e31e5c in ?? () from /lib/tls/i686/cmov/libc.so.6
#4 0x00000005 in ?? ()
#5 0xbf9a10e4 in ?? ()
#6 0x00000400 in ?? ()
#7 0xb7efc108 in ?? () from /lib/tls/i686/cmov/libc.so.6

Process 24738 attached - interrupt to quit
read(4, "ibm/hotkey HKEY 00000080 0000101"..., 1024) = 34
open("/dev/tty", O_RDWR|O_NOCTTY|O_NONBLOCK) = -1 ENXIO (No such device or address)
writev(2, [{"*** glibc detected *** ", 23}, {"hald-addon-acpi: listening on ac"..., 64}, {": ", 2}, {"free(): invalid pointer", 23}, {": 0x", 4}, {"bf844e54", 8}, {" ***\n", 5}], 7) = 129
open("/etc/ld.so.cache", O_RDONLY) = 5
open("/etc/ld.so.cache", O_RDONLY) = 5
fstat64(5, {st_mode=S_IFREG|0644, st_size=73902, ...}) = 0
mmap2(NULL, 73902, PROT_READ, MAP_PRIVATE, 5, 0) = 0xb7d35000
close(5) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libgcc_s.so.1", O_RDONLY) = 5
read(5, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\31\0\000"..., 512) = 512
mmap2(NULL, 2097152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0xb7b35000
munmap(0xb7b35000, 831488) = 0
munmap(0xb7d00000, 217088) = 0
mprotect(0xb7c00000, 135168, PROT_READ|PROT_WRITE) = 0
fstat64(5, {st_mode=S_IFREG|0644, st_size=42700, ...}) = 0
mmap2(NULL, 41700, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 5, 0) = 0xb7f12000
mmap2(0xb7f1c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 5, 0xa) = 0xb7f1c000
close(5) = 0
munmap(0xb7d35000, 73902) = 0
write(2, "======= Backtrace: =========\n", 29) = 29
writev(2, [{"/lib/tls/i686/cmov/libc.so.6", 28}, {"[0x", 3}, {"b7de8d65", 8}, {"]\n", 2}], 4) = 41
writev(2, [{"/lib/tls/i686/cmov/libc.so.6", 28}, {"(", 1}, {"cfree", 5}, {"+0x", 3}, {"90", 2}, {")", 1}, {"[0x", 3}, {"b7dec800", 8}, {"]\n", 2}], 9) = 53
writev(2, [{"/usr/lib/libdbus-1.so.3", 23}, {"(", 1}, {"dbus_free", 9}, {"+0x", 3}, {"21", 2}, {")", 1}, {"[0x", 3}, {"b7ef1a91", 8}, {"]\n", 2}], 9) = 52
writev(2, [{"/usr/lib/libdbus-1.so.3", 23}, {"(", 1}, {"dbus_error_free", 15}, {"+0x", 3}, {"40", 2}, {")", 1}, {"[0x", 3}, {"b7eda040", 8}, {"]\n", 2}], 9) = 58
writev(2, [{"hald-addon-acpi: listening on ac"..., 64}, {"[0x", 3}, {"804904c", 7}, {"]\n", 2}], 4) = 76
writev(2, [{"hald-addon-acpi: listening on ac"..., 64}, {"[0x", 3}, {"8049463", 7}, {"]\n", 2}], 4) = 76
writev(2, [{"/lib/tls/i686/cmov/libc.so.6", 28}, {"(", 1}, {"__libc_start_main", 17}, {"+0x", 3}, {"e0", 2}, {")", 1}, {"[0x", 3}, {"b7d95050", 8}, {"]\n", 2}], 9) = 65
writev(2, [{"hald-addon-acpi: listening on ac"..., 64}, {"[0x", 3}, {"8048ec1", 7}, {"]\n", 2}], 4) = 76
write(2, "======= Memory map: ========\n", 29) = 29
open("/proc/self/maps", O_RDONLY) = 5
read(5, "08048000-0804b00...

Read more...

Revision history for this message
Paul Sladen (sladen) wrote :

$ sudo ltrace -p 26054
--- SIGSTOP (Stopped (signal)) ---
--- SIGSTOP (Stopped (signal)) ---
sscanf(0xbf9df878, 0x8049f37, 0xbf9dfa78, 0xbf9df978, 0xbf9df774) = 4
snprintf("/org/freedesktop/Hal/devices/acp"..., 256, "/org/freedesktop/Hal/devices/acp"...) = 38
dbus_error_is_set(0xbf9df760, 256, 0x804a01c, 0xbf9df978, 0xbf9df774) = 1
dbus_error_free(0xbf9df760, 256, 0x804a01c, 0xbf9df978, 0xbf9df774 <unfinished ...>
--- SIGABRT (Aborted) ---
+++ killed by SIGABRT +++

Revision history for this message
Paul Sladen (sladen) wrote :

sudo /etc/init.d/hal restart
sudo gdb -p `ps aux | awk '/hald-addon-acpi[:]/{print $2}'`

(gdb) break sscanf
(gdb) cont
Breakpoint 1, 0xb7dc14e4 in sscanf () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0 0xb7dc14e4 in sscanf () from /lib/tls/i686/cmov/libc.so.6
#1 0x08048ff3 in main_loop (ctx=0x804cd60, eventfp=0x8050910) at addon-acpi.c:192
#2 0x08049463 in main (argc=795697769, argv=0x6b746f68) at addon-acpi.c:294
#3 0xb7d81050 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#4 0x08048ec1 in _start ()
(gdb) up
#1 0x08048ff3 in main_loop (ctx=0x804cd60, eventfp=0x8050910) at addon-acpi.c:19
(gdb) display event
3: event = "ibm/hotkey HKEY 00000080 00001011\n\000�0�\004\b�=ѿ\0002�%\000\000\000\000\000\000\000\000����\020<ѿH=ѿt�ӷ0�\004\b�\030ַ�����\017���l��\025\031ַ\205�c\t �\004\bH<ѿ\vL����׷\a\031ַD���4����P׷\024\000ѿ\231\234���\030ַ@����o��\214<ѿ\224P���<ѿ�O��d<ѿ", '\0' <repeats 12 times>, "�/��\214<ѿp=ѿC�\001�\005\000"...

<mjg59> sladen: Looks broken to me
(gdb) list main_loop,+15
180 char event[256];
181
182 while (fgets (event, sizeof event, eventfp))
183 {
184 HAL_DEBUG (("event is '%s'", event));
185
186 if (sscanf (event, "%s %s %x %x", acpi_path, acpi_name, &acpi_num1, &acpi_num2) == 4) { //<<<<<<<
187 char udi[256];
188
189 snprintf (udi, sizeof (udi), "/org/freedesktop/Hal/devices/acpi_%s", acpi_name);
190
191 if (strncmp (acpi_path, "button", sizeof ("button") - 1) == 0) {
192 char *type;
193
194 HAL_DEBUG (("button event"));

Revision history for this message
Paul Sladen (sladen) wrote :

(gdb) break dbus_error_free
Breakpoint 1 at 0xb7f7501a: file dbus-errors.c, line 187.
(gdb) cont
Continuing.

Breakpoint 1, dbus_error_free (error=0xbfce6270) at dbus-errors.c:187
187 dbus-errors.c: No such file or directory.
        in dbus-errors.c
(gdb) bt
#0 dbus_error_free (error=0xbfce6270) at dbus-errors.c:187
#1 0x0804904c in main_loop (ctx=0x804cd60, eventfp=0x8050910) at addon-acpi.c:239
#2 0x08049463 in main (argc=Cannot access memory at address 0x6

...

Changed in hal:
assignee: nobody → sladen
status: New → In Progress
Revision history for this message
Paul Sladen (sladen) wrote :

hal (0.5.9.1-6ubuntu3) gutsy; urgency=low

   * Add '26-addon-acpi-fix-free-before-init.diff' to fix error handling
     in addon-acpi.c:main_loop(). (LP: #148467)

 -- Paul Sladen <email address hidden> Thu, 04 Oct 2007 20:13:58 +0300

Changed in hal:
status: In Progress → Fix Released
Revision history for this message
Paul Sladen (sladen) wrote :

This is a total mess.

 * kernel's "video" module got changed (note: /sys/module/video/parameters/no_automatic_changes)
 * hal-add-acpi had broken dbus error
 * gnome-power-manager has had API churn changing stuff from UINT to INT.

Changed in gnome-power:
status: Unknown → New
Changed in gnome-power:
status: New → Fix Released
Revision history for this message
Andres Herrera (andresh) wrote :

closing this bug since the slider was removed from the current version

Changed in gnome-power-manager:
status: New → Invalid
Changed in gnome-power:
importance: Unknown → Medium
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-39

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.