Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 410033 - sys-power/cpufreqd crashes on AC transition or startup with ACPI battery support
Summary: sys-power/cpufreqd crashes on AC transition or startup with ACPI battery support
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-03-28 16:32 UTC by Steven Newbury
Modified: 2014-05-11 08:06 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Do not call close_battery() when open_battery() fails (cpufreqd-2.4.2-battery-crash.patch,399 bytes, patch)
2012-03-28 16:34 UTC, Steven Newbury
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Newbury 2012-03-28 16:32:53 UTC
A race condition exists between enumeration and reading of attributes.  This is triggered in my case by the ACPI BIOS randomally making the battery disappear and reappear whilst transitioning between AC/Battery, it's much more likely to occur with multiple batteries due to the larger window.

The actual cause of the crash: close_battery() is called after open_battery() fails, which obviously won't work since close_battery() attempts to free unallocated memory; glibc detects info[x] is an invalid pointer.



Reproducible: Sometimes

Steps to Reproduce:
1.Emerge cpufreqd with ACPI support
2.Use on an ACPI supported platform with one or more batteries (+ buggy bios?)
3.Insert or remove AC power
Actual Results:  
cpufreqd daemon crashes

Expected Results:  
Should not crash.
Comment 1 Steven Newbury 2012-03-28 16:34:13 UTC
Created attachment 307007 [details, diff]
Do not call close_battery() when open_battery() fails
Comment 2 Pacho Ramos gentoo-dev 2014-05-11 08:06:42 UTC
dropped