GNOME Bugzilla – Bug 427562
[PATCH] crashes on newer kernels a acpiinfo->{ac,battery}_state_state = NULL
Last modified: 2007-06-29 01:15:02 UTC
Steps to reproduce: no user might have seen this as this only happens when /proc/acpi/info is not available (happens with newer kernels - /proc/acpi/info is deprecated...). then update_battery_info() returns without setting acpiinfo->{ac,battery}_state_state -> NULL pointer -> crash. I am attaching a patch. Stack trace: Other information:
Created attachment 85988 [details] [review] acpi fix
Exploding priority as others are starting to see this on 2.6.21 now.
Created attachment 90085 [details] [review] gnome-applets-acpi-depreciated-procfs.patch Attached is a successfully tested patch to update for reading the kernel ACPI version in the new /sys/module/acpi/parameters/acpica_version sysfs entry. However I would note there is also a second issue which might confuse people. The gnome-power-manager creates a battery a notification icon (not an applet) and folk might have previously disabled the original battery applet. Unfortunately this is also no longer being created as hal is also not up to date with Linux acpi procfs depreciation either. There was a change in hal 0.5.9 to get the kernel ACPI version from /sys/firmware/acpi/info but where they got this bogus entry from who knows...
Created attachment 90096 [details] [review] more complete fix This is a patch based on Alan's which also improves error handling/checking in other parts of the source (I suspect the ACPI battery info will be moved to sysfs sometime soon) in order to avoid potential NULL derefs. I also moved the version detection to the initialisation part (it was being checked on every battery event). If it helps, I can commit this if it's acceptable. Thanks!
approving this one on blind faith -- i can't test this patch. please proceed with caution :)
sorry for the delay here -- wanted to find time to test it again. I'm confident. Committed :)