On my desktop without battery/ac devices reported by upower, the panel plugin crashes at startup with the following trace: (gdb) bt #0 0x00001a0fcdedb930 in g_markup_escape_text () from /usr/local/lib/libglib-2.0.so.4000.0 #1 0x00001a0fd6e39c1b in gtk_widget_set_property () from /usr/local/lib/libgtk-x11-2.0.so.2400.0 #2 0x00001a10575289b6 in g_object_set_valist () from /usr/local/lib/libgobject-2.0.so.4000.0 #3 0x00001a1057528cda in g_object_set () from /usr/local/lib/libgobject-2.0.so.4000.0 #4 0x00001a10212bce1d in power_manager_button_show () from /usr/local/lib/xfce4/panel/plugins/libxfce4powermanager.so #5 0x00001a10212bbb2d in xfce_panel_module_realize () from /usr/local/lib/xfce4/panel/plugins/libxfce4powermanager.so #6 0x00001a1057520423 in g_closure_invoke () from /usr/local/lib/libgobject-2.0.so.4000.0 #7 0x00001a105753702d in signal_emit_unlocked_R () from /usr/local/lib/libgobject-2.0.so.4000.0 #8 0x00001a105753900d in g_signal_emit_valist () from /usr/local/lib/libgobject-2.0.so.4000.0 #9 0x00001a10575397a1 in g_signal_emit () from /usr/local/lib/libgobject-2.0.so.4000.0 #10 0x00001a0fd6e34ca7 in gtk_widget_realize () from /usr/local/lib/libgtk-x11-2.0.so.2400.0 #11 0x00001a0fd6e354c8 in gtk_widget_map () from /usr/local/lib/libgtk-x11-2.0.so.2400.0 #12 0x00001a105752019d in _g_closure_invoke_va () from /usr/local/lib/libgobject-2.0.so.4000.0 #13 0x00001a105753859f in g_signal_emit_valist () from /usr/local/lib/libgobject-2.0.so.4000.0 #14 0x00001a10575397a1 in g_signal_emit () from /usr/local/lib/libgobject-2.0.so.4000.0 #15 0x00001a0fd6e35be6 in gtk_widget_show () from /usr/local/lib/libgtk-x11-2.0.so.2400.0 #16 0x00001a0d70e03e86 in main () from /usr/local/lib/xfce4/panel/wrapper-1.0 will rebuild with debug symbols for more info.
with debug syms, the crash comes from #4 0x000002680e7b0fcd in power_manager_button_show (button=0x267cffc60b0) at ../power-manager-button.c:731 #5 0x000002680e7afc2d in xfce_panel_module_realize (xpp=0x26869d59130) at xfce-power-manager-plugin.c:75
Seems the crash is caused by display_device being reported NULL in power_manager_button_set_tooltip().
eric, did you test the panel plugin without batteries reported by upower ? i cant make any sense of this failure, since there's a fallback codepath in set_tooltip for the case where display_device is null..
Yes... and I want to automate some of that with Jenkins in the future. What version of xfpm and UPower are you using? Is your system 32bit? I'm just looking for how to reproduce this easily. http://i.imgur.com/bYlUs2s.png That's the power manager plugin running on OpenBSD without any devices reported by UPower.
xfpm 1.3.2, upower 0.99.0, OpenBSD/amd64. Havent tested i386 yet, but will soon, since i have an amd64 and an i386 laptop where xfpm will be more useful rather than on this desktop... $upower -d Device: /org/freedesktop/UPower/devices/DisplayDevice power supply: no updated: Thu Jan 1 01:00:00 1970 (1408864470 seconds ago) has history: no has statistics: no unknown warning-level: none icon-name: '' Daemon: daemon-version: 0.99.0 on-battery: no lid-is-closed: no lid-is-present: no is-docked: no critical-action: PowerOff (note that i'm also the upower maintainer in OpenBSD, and i wrote the backend inside upower, so if stuff need fixing/updating in upower itself i can have a look at it...)
Created attachment 5612 Prevent a crash on desktop systems I'm pretty sure it's a bug in xfpm. If it's just the tooltip that breaks it, we can remove the tooltip. It's not like it's really useful for desktop systems anyway. Let me know if this patch fixes it.
Comment on attachment 5612 Prevent a crash on desktop systems Yeah, the plugin doesnt crash with that line removed, and the button menu only has 'presentation mode' entry, the tooltip on the button is 'Computer', but i'd rather have the root cause of the bug fixed instead of shoving stuff under the carpet like this :)
Created attachment 5613 Try to pinpoint where it crashes Me too. Can you try this patch with PANEL_DEBUG=1 xfce4-panel ? I'd like to see where we broke it. Thanks!
oh and built with ./autogen.sh --enable-debug=yes (full probably won't work because of the g value array stuff).
xfce4-panel-Message: Plugin power-manager-plugin-9 has been automatically restarted after crash. xfce4-panel(external): power-manager-plugin-9: scheduled a respawn of the child xfce4-panel(external): power-manager-plugin-9: child is unembedded xfce4-panel(external): power-manager-plugin-9: child spawned; pid=7818, argc=8 xfce4-panel(external): power-manager-plugin-9: child is embedded; 5 properties in queue ** (wrapper-1.0:12222): WARNING **: No outputs have backlight property ** (xfpm-power-backlight-helper:10490): WARNING **: failed to find any devices: Erreur ? l'ouverture du r?pertoire ??/sys/class/backlight???: (null) DBG[../power-manager-button.c:197] power_manager_button_set_tooltip(): setting generic tooltip DBG[../power-manager-button.c:197] power_manager_button_set_tooltip(): setting generic tooltip xfce4-panel(external): power-manager-plugin-9: child is unembedded xfce4-panel(external): power-manager-plugin-9: child exited with status 139 and then there's the crash dialog..
Created attachment 5620 plugin: Fix crash when devices (dis)connect Hey, haven't forgotten about this bug. I may not be able to reproduce it because I don't have an actual desktop to test with. I built another OpenBSD VM with UPower from git but it naturally wouldn't crash for me. However, I did find a way to make it crash (and that lead to a couple more corner cases). Anyway, can you try this patch out please? If it does still crash can you provide the backtrace from PANEL_DBG=gdb xfce4-panel with the patch? Maybe it will crash somewhere new.
WIth that patch, it seems it doesnt crash anymore, and the output is: DBG[../power-manager-button.c:653] set_brightness_min_level(): button->priv->brightness_min_level : 0 DBG[../power-manager-button.c:384] power_manager_button_update_device_icon_and_details(): this is the display device, updating DBG[../power-manager-button.c:825] power_manager_button_set_icon(): icon_width 24 DBG[../power-manager-button.c:825] power_manager_button_set_icon(): icon_width 26 DBG[../power-manager-button.c:1019] power_manager_button_menu_add_device(): filtering device from menu (display or line power device) DBG[../power-manager-button.c:1019] power_manager_button_menu_add_device(): filtering device from menu (display or line power device) So, that's an improvement. The menu shows 'power manager settings' but nothing happens when i click on that item, and the last line in the debug log is added each time i try to click on it.
oh sorry, disregard the last part of the previous comment, the xfpm settings dialog is correctly displayed when i click on the item, it was an issue on my side (had removed the package for xfpm, was just running the panel plugin from my git checkout .libs directory.
Awesome, thanks for testing all these patches. Pushed to master: commit 2e0de98b0b4322b92096554e3248a15771b3f9e3 Author: Eric Koegel <eric.koegel@gmail.com> Date: Sun Aug 31 21:11:56 2014 +0300 plugin: Fix crash when devices (dis)connect There are a couple conditions where the plguin would crash or emit runtime warnings due a device being connected or disconnected. Those should be fixed now. http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=2e0de98b0b4322b92096554e3248a15771b3f9e3
Grr... i'm sorry, but right now with 1.4.2 the same failure is back...
Backtrace still the same as in comment 0, and on stderr: ** (xfpm-power-backlight-helper:14579): WARNING **: failed to find any devices: Erreur ? l'ouverture du r?pertoire ??/sys/class/backlight???: No such file or directory DBG[../power-manager-button.c:651] set_brightness_min_level(): button->priv->brightness_min_level : 0 xfce4-panel-Message: Plugin power-manager-plugin-10 has been automatically restarted after crash. Wonder if this has to do with the fact that brightness handling is expected to be present?
Note that it also crashes on a laptop with a battery reported by upower.
(In reply to Landry Breuil from comment #16) > Backtrace still the same as in comment 0, and on stderr: > > ** (xfpm-power-backlight-helper:14579): WARNING **: failed to find any > devices: Erreur ? l'ouverture du r?pertoire ??/sys/class/backlight???: No > such file or directory > DBG[../power-manager-button.c:651] set_brightness_min_level(): > button->priv->brightness_min_level : 0 > xfce4-panel-Message: Plugin power-manager-plugin-10 has been automatically > restarted after crash. > > Wonder if this has to do with the fact that brightness handling is expected > to be present? I've same problem under FreeBSD. I use my own backend [1] (based on sysctl instead sysfs). Tested on laptop without battery and acpi_video(4) not well supported. [1] https://subversion.assembla.com/svn/xfce4/trunk/sysutils/xfce4-power-manager/files/
I'm not sure this is related to the crash i'm seeing, but xfpm should gracefully fallback if there's no support for backlight.. Do you plan to push back you backlight patch for freebsd ? Too bad upower itself only seems to support kbd backlight and not the actual screen brightness...
Okay. I finally decided to tackle that issue, and as usual .. that's because my env is *not* in UTF-8. I have LC_CTYPE/LC_MESSAGES set to fr_FR.ISO8859-15, and the issue is caused by a missing call to xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8"); in the panel plugin initialization, say power_manager_plugin_new() or power_manager_plugin_construct(). This line is in xfpm and xfpm-settings, but not the plugin.. adding this missing line on top of 1.4.3 produces a working panel plugin with french localization, properly showing battery device and brightness control. finally. Phew. Do you want me to append a git-format-patch or ... ?
Sure! Unless you to push it yourself. I would have never guessed the text domain thing... Nice find.
Created attachment 6026 Fix panel crashes when locale is not UTF-8 I use this patch, and everything is fine. Thanks Landry.
Thanks Landry and Olivier! Pushed to master in: commit 7e3be2a03b4d4b950b31554bb93ce0cebf29475e Author: Olivier Duchateau <duchateau.olivier@gmail.com> Date: Mon Mar 2 06:41:31 2015 +0000 Fix xfpm panel plugin crashes at startup when the locale is not UTF8 Signed-off-by: Eric Koegel <eric.koegel@gmail.com> http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=7e3be2a03b4d4b950b31554bb93ce0cebf29475e