Incorrect Truncation of Battery-Type report

Bug #120708 reported by TJ
4
Affects Status Importance Assigned to Milestone
acpitool (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: acpitool

In the source for acpitool 0.4.7, the definition of Battery_Info->Technology as char[13] arbitrarily truncates the length of the reported battery-technology, amongst other things. This leads to acpitools reporting a battery-technology that is inconsistent with other ACPI and hal tools which can lead to confusion when diagnosing battery-related issues.

$ acpitool -Bv
  Battery #1 : present
    Remaining capacity : 15510 mWh, 26.87%
    Design capacity : 57720 mWh
    Last full capacity : 57720 mWh
    Present rate : unknown
    Charging state : discharging
    Battery type : non-recharge, LiOn

At or around line 36 of src/acpitool.h:

struct Battery_Info {
    int Battery_Present;
    char Charging_State[12];
    char Remaining_Cap[10];
    char Design_Cap[10];
    char LastFull_Cap[10];
    char Present_Rate[10];
    char Technology[13];
    char Model[13];
    char Serial[13];
    char Bat_Type[13];
};

This limits the reported battery-technology to 13 bytes which will in particular truncate the report of "non-rechargeable" to "non-recharge".

The reporting line in battery.cpp then displays the truncated message:

  cout<<" Battery type : "<<Batt_Info[i]->Technology<<", "<<Batt_Info[i]->Bat_Type<<endl;

On the face if it this looks cosmetic but when trying to diagnose an ACPI problem where ACPI battery-technology is reported as "non-recharge" but hal reports the battery as rechargeable, this truncation caused confusion over where the reported string was originating and diverted effort into determining where the various reports originated from.

Revision history for this message
TJ (tj) wrote :
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report. Regarding activity, this project seems to be orphaned. There hasn't been any update upstream since Feb. 2007.
BTW the inconsistence you've seen may come from the fact that acpitool queries /proc but not the new /sys power interface.
Did you try to contact the original maintainer Nicolas Weyland at ufoalien at weyland dot ch ?

We have the following choices:
- Set status to confirm and report it to debian because there is a bug indeed. But it will probably lay there forever
- Propose a debdiff and find a MOTU to sponsor it
- Close the report

Without response, this report will be closed in 4 weeks.

Thanks

Changed in acpitool:
status: New → Incomplete
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Closing this report regarding the package is not maintained upstream and no one seem to be inclined to produce a patch.

Thanks for your time.

Changed in acpitool:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.