! 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 !
xfce4-power-manager-settings crashes (git build)
Status:
RESOLVED: FIXED
Product:
Xfce4-power-manager
Component:
General

Comments

Description Simon P 2014-07-13 16:55:18 CEST
(debian/testing on 32bit notebook)

I'm running xfce4-power-manager built from git master since switching my system to systemd (no updated version is yet in the debian repository). The daemon runs ok, but the settings dialogue crashes (SIGSEGV) after an apparently random time: sometimes before gui is up, sometimes after.

I tracked down the commit responsible to:
    http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=47d4ba88c43f97427746839363bced83e191afc1

Reviewing the code there, I see an unwise (IMHO) use of strcat() which is evidently leading to memory corruption. Here's a rewrite of the last block of code in that commit, which fixes this for me:

        {
            gchar *str2;

            /* TRANSLATORS: Unit here is Watt hour*/
            str = xfpm_info_get_energy_property (energy_full, _("Wh"));
            str2 = g_strdup_printf ("%s (%d%%)", str, (guint) (energy_full / energy_full_design *100));

            update_device_info_value_for_name (view, list_store, _("Fully charged"), str2);

            g_free (str);
            g_free (str2);
        }
Comment 1 Eric Koegel editbugs 2014-07-13 21:37:24 CEST
Thank you. I turned your bug report into a patch and committed it to master in:
http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=07662a6042922d7abf504cc2ae4105a8831b4667

Bug #11018

Reported by:
Simon P
Reported on: 2014-07-13
Last modified on: 2014-07-13

People

Assignee:
Ali Abdallah
CC List:
1 user

Version

Version:
Unspecified

Attachments

Additional information