Subject: race condition in APM support?
To: None <current-users@netbsd.org>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: current-users
Date: 06/14/2006 11:07:39
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.

Has anyone seen anything like this?  Any suggestions on tracking it down?

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