After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 659205 - power: possible sigfpe
power: possible sigfpe
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: power
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Richard Hughes
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2011-09-16 02:19 UTC by Matthias Clasen
Modified: 2011-09-16 08:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthias Clasen 2011-09-16 02:19:17 UTC
reading the code of engine_update_composite_device, I can't help the feeling that 
energy_full_total can still be zero by the time we reach

        percentage = 100.0 * energy_total / energy_full_total;

That could happen if the array has zero devices, or if all devices hit the continue statement in the body of the loop.
Comment 1 Richard Hughes 2011-09-16 08:17:34 UTC
(In reply to comment #0)
> That could happen if the array has zero devices, or if all devices hit the
> continue statement in the body of the loop.

Each call to engine_update_composite_device() is only done if there is at least one battery, which also means that the continue will not be hit every time -- BUT if all the batteries are broken, then this does indeed mean *bang*.

commit d06b9cae10d4a482f76b32394334ebec6073751f
Author: Richard Hughes <richard@hughsie.com>
Date:   Fri Sep 16 09:15:35 2011 +0100

    power: Protect against a potential SIGFE
    
    This can only happen if all laptop batteries have zero energy_full.
    
    Resolves https://bugzilla.gnome.org/show_bug.cgi?id=659205