You are not logged in.
Pages: 1
I updated powertop today. If I wat to start it, I get an error:
terminate called after throwing an instance of 'std::ios_base::failure'
what(): basic_filebuf::underflow error reading the file
Anyone here who can help me?
edit: I downgraded and everything works again, but what can I do for upgrading? I could never read how many watts my notebook needed, by the way. That never worked for me so far.
Last edited by Kopfweh (2012-05-13 19:13:10)
Offline
Hi,
what happens if you type that into your console:
cat /sys/class/power_supply/BAT/current_now
Maybe you have to replace BAT with BAT0 or something else. If your console spits an error message, then the reason for powertop crashing is that it tries to open that path, gets an uncaught exception and dies. My laptop has the same problem with the current, too. How to fix:
Get the powertop sources, edit "src/measurement/sysfs.cpp":
In sysfs_power_meter::get_sysfs_attr replace
snprintf(filename, sizeof(filename), "/sys/class/power_supply/%s/%s", name, attribute);
*value = read_sysfs(filename, &ok);
with
snprintf(filename, sizeof(filename), "/sys/class/power_supply/%s/%s", name, attribute);
try
{
*value = read_sysfs(filename, &ok);
}
catch(...)
{
return false;
}
This would be a proper solution. Hope that some dev reads it and merges it into the next version.
Last edited by Toddy (2012-05-16 16:52:30)
Offline
A friend of mine had that too. It happens only when on battery, so probably Toddy found the issue.
I'll check that with my friend tomorrow.
Offline
Pages: 1