After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 427562 - [PATCH] crashes on newer kernels a acpiinfo->{ac,battery}_state_state = NULL
[PATCH] crashes on newer kernels a acpiinfo->{ac,battery}_state_state = NULL
Status: RESOLVED FIXED
Product: gnome-applets
Classification: Other
Component: battery
git master
Other All
: Normal blocker
: ---
Assigned To: gnome-applets Maintainers
gnome-applets Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-04-08 12:07 UTC by bugreports
Modified: 2007-06-29 01:15 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
acpi fix (1.18 KB, patch)
2007-04-08 12:08 UTC, bugreports
none Details | Review
gnome-applets-acpi-depreciated-procfs.patch (1.06 KB, patch)
2007-06-16 17:48 UTC, Alan Swanson
none Details | Review
more complete fix (4.30 KB, patch)
2007-06-16 20:31 UTC, Daniel Drake
committed Details | Review

Description bugreports 2007-04-08 12:07:09 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:
Comment 1 bugreports 2007-04-08 12:08:49 UTC
Created attachment 85988 [details] [review]
acpi fix
Comment 2 bugreports 2007-04-28 19:12:39 UTC
Exploding priority as others are starting to see this on 2.6.21 now.
Comment 3 Alan Swanson 2007-06-16 17:48:09 UTC
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...
Comment 4 Daniel Drake 2007-06-16 20:31:19 UTC
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!
Comment 5 Allison Karlitskaya (desrt) 2007-06-25 04:01:47 UTC
approving this one on blind faith -- i can't test this patch.


please proceed with caution :)
Comment 6 Daniel Drake 2007-06-29 01:15:02 UTC
sorry for the delay here -- wanted to find time to test it again. I'm confident. Committed :)