Subject: Re: race condition in APM support?
To: None <current-users@NetBSD.org>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: current-users
Date: 06/15/2006 21:54:28
A few days ago I posted this note.  I was wrong; I now suspect a BIOS bug
and/or a hardware issue.

> I suspect that there's a race condition in the APM support, but I'm not
> certain, and don't really know how to track it down.
> 
> Here's the situation.  I have a Thinkpad T42 with two batteries, one of
> which is very bad.  (A replacement is on order.)  Three times in the last
> week, while I was running on battery with high power drain (wireless
> networking, high CPU use, and intensive disk activity), the machine has
> turned itself off.  Looking at the battery level after rebooting, I
> believe that the bad battery had hit 0%.
> 
> I suspect that what's happening is that some APM events are coming in very
> close together, and that that's confusing something in the APM support.  A
> race condition is the obvious guess, though I have no evidence to support
> it.  Neither apmd nor sysutils/asapm seem to have any defaults to power
> off the machine.  The BIOS will, when the battery power is about 0%, but
> that would apply to the total battery, not one battery.  I can't, of
> course, rule out a BIOS bug, and I'll certainly be checking the Lenovo web
> site.
> 
To do a battery lifetime test, I decided to run Windows on a long plane
flight -- all I planned to do was read a large PDF and take notes on it,
and that's the sort of thing that even Windows can handle, albeit with its
usual annoying human factors.  But the same thing and worse happened --
not only did the machine turn itself off, I couldn't even get it to power
on until I removed the suspect battery.  It's clear that it's an
ex-battery, and not merely pining for the fjords.

		--Steven M. Bellovin, http://www.cs.columbia.edu/~smb