New issue
Advanced search Search tips

Issue 765162 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

dump_power_status aborts instead of exiting with 1 when run on broken systems

Project Member Reported by tnagel@chromium.org, Sep 14 2017

Issue description

Chrome Version: 63.0.3212.0 / 9928.0.0

What steps will reproduce the problem?
(1) I have a mighty PVT SKU2 with dead battery.
(2) After unplugging power for ~2 hours and replugging it, running dump_power_status from the console reproducibly results in a crash. (After a few minutes the crash disappears, likely because some input values have changed.)

Output:

[0910/034659:WARNING:power_supply.cc(898)] Ignoring reading with bad or missing nominal (0) and instantaneous (0) voltages
open("/proc/self/status", O_RDONLY|O_LARGEFILE) = 11
[0910/034659:FATAL:dump_power_status.cc(31)] Check failed: power_supply.RefreshImmediately(). 

Attaching log of "strace -eopen dump_power_status".
 
Cc: derat@chromium.org

Comment 2 by tnagel@chromium.org, Sep 14 2017

And another log without "-eopen".
log2.txt
35.5 KB View Download
Ideas after discussion with tnagel:

The CHECK() was appropriate while dump_power_status was just a testing tool. Since we're now using it in production, it makes sense to replace that CHECK either with an exit(N) where N is a status code that indicates "broken battery". Or alternatively, we could continue and print status, making sure that battery_present=0, or maybe even battery_present=broken?

Comment 4 by derat@chromium.org, Sep 14 2017

Cc: snanda@chromium.org
Components: -OS>Systems OS>Kernel>Power
Labels: -Pri-1 Pri-2
Summary: dump_power_status aborts instead of exiting with 1 when run on broken systems (was: crash in dump_power_status)
The initial report appears to be describing dump_power_status being used as a testing tool (i.e. run from the console). Is the fact that it aborts when run on a broken system rather than exiting with 1 causing problems in some production use? (I wasn't aware that there were any non-test uses of dump_power_status, although it looks like it's used by some firmware-updating scripts now.)
Labels: -Pri-2 Pri-3
I am guilty for using dump_power_status in the tpm firmware updater script, but only after I had asked you whether that's OK. I have an email thread to prove this :-p

The abort we're seeing is not a problem right now as we behave correctly and assume there's no battery present so we don't need to check for sufficient charge.

So this is merely a cosmetic issue as long as we don't have consumers of dump_power_status that want to distinguish "broken" from "no battery" situations. tnagel@ still has a point that aborting in a situation that will happen from time to time isn't ideal (unnecessary crash reports etc.)

Comment 6 by derat@chromium.org, Sep 15 2017

This is indicative of broken hardware and/or EC or kernel bugs, though. In theory, someone could use these crash reports to identify and try to fix these issues. I'm fine with changing dump_power_status to exit with 1 if you think that that'll never happen. Making it continue in the face of errors would be a bit more work (since this code is shared with powerd, and I don't want to change powerd's behavior).

Comment 7 by snanda@chromium.org, Sep 15 2017

Cc: tbroch@chromium.org
Cc: -derat@chromium.org
Owner: derat@chromium.org
Status: Assigned (was: Untriaged)
Tend to agree w/ Dan's point that we want to surface these crash reports for faulty HW.

Sign in to add a comment