Your message dated Thu, 2 Jul 2026 13:05:16 +0200
with message-id <[email protected]>
and subject line Re: upower crashes due to -NaN battery percentage from ACPI
has caused the Debian Bug report #1109970,
regarding upower crashes due to -NaN battery percentage from ACPI
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1109970: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1109970
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: upower
Version: 1.90.3-1
Severity: important
Tags: patch upstream

Dear Maintainer,

On systems with broken battery controllers, ACPI may report an invalid battery
capacity value, specifically `-NaN`. This causes `upowerd` to crash repeatedly
due to an invalid gdouble being passed to `g_object_set`.

This leads to system instability or continuous reboots due to repeated crashes
of systemd-managed services.

The following patch adds a basic sanity check to clamp invalid values to 0.0.

--- PATCH START ---
--- upower-1.90.3.orig/src/linux/up-device-supply.c
+++ upower-1.90.3/src/linux/up-device-supply.c
@@ -313,6 +313,11 @@ up_device_supply_refresh_device (UpDevic
        if (percentage == 100.0)
                state = UP_DEVICE_STATE_FULLY_CHARGED;
 
+       if (!isfinite(percentage) || percentage < 0.0 || percentage > 100.0) {
+               g_warning("Invalid percentage value: %f, setting to 0.0", 
percentage);
+               percentage = 0.0;
+       }
+
        g_object_set (device,
                      "percentage", percentage,
                      "battery-level", level,
--- PATCH END ---

Tested on affected system; no crash occurs after patch is applied.

Regards,  
Renkas Mykhailo

--- End Message ---
--- Begin Message ---
Version: 1.19.1-1

On Sun, 10 May 2026 23:04:57 +0100 James Addison <[email protected]> wrote:
Package: upower
Followup-For: Bug #1109970
X-Debbugs-Cc: [email protected], [email protected], 
[email protected]

Hi Renkas, Michael,

There appears to be a fix that landed in v1.91.1 of upower (the bugfix has git
commit ID 988624350b5c29818c0ee0114f16ace011767165) to resolve upower crashes
due to this NaN issue:

 https://gitlab.freedesktop.org/upower/upower/-/merge_requests/306

Thanks, closing this particular bug report for this version.

Michael

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


--- End Message ---

Reply via email to