! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
New LCD Brightness Plugin Crash
Status:
RESOLVED: FIXED
Product:
Xfce4-power-manager
Component:
General

Comments

Description ToZ editbugs 2014-08-02 01:21:03 CEST
Created attachment 5579 
PANEL_DEBUG=1 output

The new LCD brighntness plugin is crashing when I try to adjust the slider with the error message (in Arch's journal):
"Aug 01 15:21:08 archer kernel: panel-7-xfce4-b[21341]: segfault at 461d5a0b ip b77675b0 sp bf938ea0 error 4 in libxfce4battery.so[b7762000+d000"

LCD brightness on the system works fine otherwise using keyboard shortcuts or echo'ing values directly into the interface's brightness file.

-----

System Information:
Toshiba Tecra S3
NVIDIA Corporation NV43M [GeForce Go 6600]
Only one backlight interface (/sys/class/backlight/toshiba).
Running Arch Linux fully updated.
All Xfce components being built from git.

-----

With xfce4-panel built with "--enable-debug=full" and running xfce4-panel with PANEL-DEBUG=1 xfce4-panel displays the following snippet during crash:
"TRACE[../scalemenuitem.c:263] scale_menu_item_button_press_event(): entering
TRACE[../scalemenuitem.c:332] scale_menu_item_grab_notify(): entering
TRACE[../scalemenuitem.c:332] scale_menu_item_grab_notify(): entering
TRACE[../battery-button.c:831] range_value_changed_cb(): entering
xfce4-panel(external): xfce4-battery-plugin-7: child exited with status 11
xfce4-panel-Message: Plugin xfce4-battery-plugin-7 has been automatically restarted after crash.
xfce4-panel(external): xfce4-battery-plugin-7: scheduled a respawn of the child
xfce4-panel(external): xfce4-battery-plugin-7: child is unembedded
xfce4-panel(external): xfce4-battery-plugin-7: child spawned; pid=14292, argc=8
xfce4-panel(external): xfce4-battery-plugin-7: child is embedded; 5 properties in queue"
(full log snippet attached).

Also attached is the gdb backtrace from running PANEL_DEBUG=gdb.

-----VERSIONS:

$ xfce4-power-manager --dump
---------------------------------------------------
       Xfce power manager version 1.3.0git-a4d9eee
With policykit support
With network manager support
With DPMS support
---------------------------------------------------
Can suspend: True
Can hibernate: True
Authorized to suspend: True
Authorized to hibernate: True
Authorized to shutdown: True
Has battery: True
Has brightness panel: True
Has power button: True
Has hibernate button: True
Has sleep button: True
Has LID: True

-----

$ xfce4-panel -V
xfce4-panel 4.11.2git-fbc0dc8 (Xfce 4.10)

Copyright (c) 2004-2011
	The Xfce development team. All rights reserved.

Please report bugs to <http://bugzilla.xfce.org/>.
Comment 1 ToZ editbugs 2014-08-02 01:21:34 CEST
Created attachment 5580 
gdb backtrace
Comment 2 Eric Koegel editbugs 2014-08-02 08:49:03 CEST
Created attachment 5583 
Fix crash in callback

The backtrace points to if (button->priv->set_level_timeout) inside of range_value_changed_cb causing the crash, so this patch checks that we do have a BatteryButton before we treat it as one. Let me know if this fixes the crash for you. Thanks for the bug report!
Comment 3 ToZ editbugs 2014-08-02 15:13:38 CEST
Created attachment 5584 
gdb log
Comment 4 ToZ editbugs 2014-08-02 15:17:52 CEST
Created attachment 5585 
New PANEL_DEBUG=1 log file
Comment 5 ToZ editbugs 2014-08-02 15:19:03 CEST
Sorry, but no luck Eric. Now crashing on:
834	    if (button == NULL || !BATTERY_IS_BUTTON (button))

The above 2 posts are the log files.
Comment 6 Eric Koegel editbugs 2014-08-02 18:02:33 CEST
Created attachment 5586 
Fix crash in callback

Ah, maybe because it's already considered a battery button. Can you try this patch?
Comment 7 ToZ editbugs 2014-08-02 20:28:30 CEST
No luck. Logs to follow.

Might be of interest: xfce4-power-manager is picking up and managing the brightness keyboard shortcuts. Snippet from journal when I press the combinations:

Aug 02 14:26:15 archer pkexec[12925]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
Aug 02 14:26:16 archer pkexec[12925]: toz: Executing command [USER=root] [TTY=unknown] [CWD=/] [COMMAND=/usr/sbin/xfpm-power-backlight-helper --set-brightness 5]
Aug 02 14:26:16 archer pkexec[12935]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
Aug 02 14:26:16 archer pkexec[12935]: toz: Executing command [USER=root] [TTY=unknown] [CWD=/] [COMMAND=/usr/sbin/xfpm-power-backlight-helper --set-brightness 4]
Aug 02 14:26:16 archer pkexec[12939]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
Aug 02 14:26:16 archer pkexec[12939]: toz: Executing command [USER=root] [TTY=unknown] [CWD=/] [COMMAND=/usr/sbin/xfpm-power-backlight-helper --set-brightness 3]
Aug 02 14:26:17 archer pkexec[12948]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
Aug 02 14:26:17 archer pkexec[12948]: toz: Executing command [USER=root] [TTY=unknown] [CWD=/] [COMMAND=/usr/sbin/xfpm-power-backlight-helper --set-brightness 2]
Aug 02 14:26:18 archer pkexec[12957]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
Aug 02 14:26:18 archer pkexec[12957]: toz: Executing command [USER=root] [TTY=unknown] [CWD=/] [COMMAND=/usr/sbin/xfpm-power-backlight-helper --set-brightness 3]
Aug 02 14:26:19 archer pkexec[12967]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
Aug 02 14:26:19 archer pkexec[12967]: toz: Executing command [USER=root] [TTY=unknown] [CWD=/] [COMMAND=/usr/sbin/xfpm-power-backlight-helper --set-brightness 4]
Aug 02 14:26:19 archer pkexec[12971]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
Aug 02 14:26:19 archer pkexec[12971]: toz: Executing command [USER=root] [TTY=unknown] [CWD=/] [COMMAND=/usr/sbin/xfpm-power-backlight-helper --set-brightness 5]
Comment 8 ToZ editbugs 2014-08-02 20:29:16 CEST
Created attachment 5587 
gdb log
Comment 9 Harald Judt 2014-08-04 10:44:47 CEST
ToZ, I also cannot reproduce this. Have you already used a version that includes http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=f2f4342685cc49f3d0d5c050df72c1c4772aed6a?

Can you try to revert http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=cee59a17df71765cde96a26440de4eb639eb21e9? It's only a quick shot in the dark, but maybe it solves your issue and then we know where to look for a solution.
Comment 10 Harald Judt 2014-08-04 10:48:49 CEST
As for reproducing, can you provide exact steps how to provoke this? Is it only dragging the slider, or are more steps necessary?
Comment 11 ToZ editbugs 2014-08-04 15:09:14 CEST
Yes, my install includes commit f2f4342685cc49f3d0d5c050df72c1c4772aed6a.

I just reverted commit cee59a17df71765cde96a26440de4eb639eb21e9, but issue persists. I will attach gdb log.

To reproduce the problem, I simply click on the battery icon to view the dropdown and brightness slider (which does accurately reflect the current value of my brightness set via the brightness keyboard keys) and attempt to slide the slider.
Comment 12 ToZ editbugs 2014-08-04 15:09:48 CEST
Created attachment 5591 
gdb log
Comment 13 ToZ editbugs 2014-08-04 15:31:16 CEST
One more piece of information to share. By default, this laptop boots with 2 backlight interfaces: acpi_video0 and toshiba. I use the "acpi_backlight=vendor" kernel parameter to remove the acpi_video0 interface. I just removed that parameter and blacklisted the toshiba_acpi kernel module (which removes the toshiba backlight interface) instead. Unfortunately, the plugin crashes under all 3 scenarios:
- both acpi_video0 & toshiba
- just acpi_video0
- just toshiba
Comment 14 Harald Judt 2014-08-04 18:19:11 CEST
It always seems to happen when trying to access button->priv->...
From the previous observations, I don't think it has to do anything with the backlight interface nor any of the xfpm backlight functionality, though it is fine that you checked this.

Just to check this: Are you using the xfce or the lxde plugin?
Comment 15 Harald Judt 2014-08-04 18:20:17 CEST
Sorry, didn't carefully read the first post. So you're using xfce.
Comment 16 ToZ editbugs 2014-08-04 23:33:56 CEST
Yes, I'm building all Xfce components directly from git.
Comment 17 Eric Koegel editbugs 2014-08-11 15:24:57 CEST
Can you try the patch from: https://bugzilla.xfce.org/show_bug.cgi?id=11076 ? Looks like the same issue with a proper fix.
Comment 18 ToZ editbugs 2014-08-12 00:23:19 CEST
Yes. This patch fixes the issue. Thanks.
Comment 19 Eric Koegel editbugs 2014-08-12 19:18:02 CEST
Awesome, glad someone found and fixed the issue. Marking resolved.

Bug #11064

Reported by:
ToZ
Reported on: 2014-08-02
Last modified on: 2014-08-12

People

Assignee:
Eric Koegel
CC List:
4 users

Version

Version:
Unspecified

Attachments

PANEL_DEBUG=1 output (11.16 KB, text/x-log)
2014-08-02 01:21 CEST , ToZ
no flags
gdb backtrace (6.46 KB, text/x-log)
2014-08-02 01:21 CEST , ToZ
no flags
Fix crash in callback (923 bytes, patch)
2014-08-02 08:49 CEST , Eric Koegel
no flags
gdb log (6.59 KB, text/x-log)
2014-08-02 15:13 CEST , ToZ
no flags
New PANEL_DEBUG=1 log file (8.05 KB, text/plain)
2014-08-02 15:17 CEST , ToZ
no flags
Fix crash in callback (1.13 KB, patch)
2014-08-02 18:02 CEST , Eric Koegel
no flags
gdb log (6.59 KB, text/x-log)
2014-08-02 20:29 CEST , ToZ
no flags
gdb log (6.59 KB, text/x-log)
2014-08-04 15:09 CEST , ToZ
no flags

Additional information