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 104160 - Dialog for missing files in /proc
Dialog for missing files in /proc
Status: RESOLVED FIXED
Product: gnome-applets
Classification: Other
Component: battery
2.3.x
Other other
: Normal enhancement
: ---
Assigned To: gnome-applets Maintainers
gnome-applets Maintainers
: 118453 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-01-22 07:45 UTC by Anish Patel
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Proposed patch to avoid the crash (498 bytes, patch)
2003-04-22 19:04 UTC, Manuel Clos
none Details | Review

Description Anish Patel 2003-01-22 16:42:35 UTC
Package: gnome-applets
Severity: critical
Version: GNOME2.2.0 0
os_details: Gnome.Org
Synopsis: battstat-applet crashes
Bugzilla-Product: gnome-applets
Bugzilla-Component: battery
BugBuddy-GnomeVersion: 2.0 (2.1.90)
Description:
Description of Problem:
Whenever I try to load the battstat applet, it segfaults.

Steps to reproduce the problem:
1. Load battstat-applet-2


Actual Results:
crash


Expected Results:
load battery applet in panel


How often does this happen?
everytime


Additional Information:
(I'm not sure what information would be useful because I'm new at this,
but if you let me know what you need, I'll do my best to provide it to
you)




------- Bug moved to this database by unknown@bugzilla.gnome.org 2003-01-22 11:42 -------

Reassigning to the default owner of the component, gnome-applets-maint@bugzilla.gnome.org.

Comment 1 Alex Duggan 2003-01-22 20:15:06 UTC
Please include a backtrace of the crash using bug-buddy or gdb.   See
http://bugzilla.gnome.org/getting-traces.cgi for more information. 
Thanks.
Comment 2 Anish Patel 2003-01-22 20:42:30 UTC
Backtrace was generated from '/usr/lib/battstat-applet-2'

(no debugging symbols found)...
Core was generated by `/usr/lib/battstat-applet-2
--oaf-activate-iid=OAFIID:GNOME_BattstatApplet_Facto'.
Program terminated with signal 11, Segmentation fault.
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...#0  0x403fc092 in pthread_mutex_lock ()
   from /lib/i686/libpthread.so.0

Thread 1 (process 3478)

  • #0 pthread_mutex_lock
    from /lib/i686/libpthread.so.0
  • #1 readdir
    from /lib/i686/libc.so.6
  • #2 acpi_linux_read

Comment 3 Kevin Vandersloot 2003-02-13 15:39:36 UTC
Is this really GNOME 2.2 or 2.0?
Comment 4 Anish Patel 2003-02-13 17:20:20 UTC
I found the source of the bug... it is not Gnome related.
The problem is with the Dell BIOS and the handling of power
managamenet.  Usinger kernel 2.4.19, the battstat applet works.
Anything higher (2.4.20 or greater) causes some problems.
Comment 5 Manuel Clos 2003-04-22 19:01:57 UTC
In acpi-linux.c: in acpi_linux_read ()

about line 189, the code reads:

procdir=opendir("/proc/acpi/battery/");
while ((procdirentry=readdir(procdir)))

The problem is that opendir will return NULL if the directory does not
exists (this happens when you don't have the battery.o module loaded).
So the code does no check for NULL and passes it to readdir which
segfaults.

about the line 228, the same problem happens with the "ac_adapter"
dir, which is not present until you load the ac.o module.

other than that, after loading the needed modules, it works great.

It will be easy to just check for "procdir == NULL", but IMHO, the
applet should also tell the user that he lacks "battery/ac"
information support.
Comment 6 Manuel Clos 2003-04-22 19:04:40 UTC
Created attachment 15910 [details] [review]
Proposed patch to avoid the crash
Comment 7 Manuel Clos 2003-04-22 19:06:24 UTC
The patch fixes the bug, which is good (tm). But please, please, if
the situation I explained happens, there is a good chance to give
feedback to the user.

Anyway knowing the code can put a simple dialog?
Comment 8 Elijah Newren 2003-04-23 23:42:17 UTC
Adding PATCH keyword and setting priority->high because of the patch.
Comment 9 Kevin Vandersloot 2003-04-25 03:00:57 UTC
Patch applied. Thanks Manuel
Comment 10 Elijah Newren 2003-07-03 19:07:10 UTC
Kevin: Resolved->fixed?  Or do you want to wait until a dialog to
inform the user of the missing directory is written?
Comment 11 Andrew Sobala 2003-07-12 18:18:23 UTC
Changing summary and retriaging
Comment 12 Kjartan Maraas 2003-07-27 23:39:18 UTC
We should either file a new bug to make sure we support the new
/proc/acpi format or change the title of this one. This needs to be
fixed on the gnome-2-2 branch as well because it crashes on a newer
2.4.x kernel which will probably be coupled with GNOME 2.2.x on a lot
of distros in the future.
Comment 13 Olivier Crête 2003-07-28 04:00:48 UTC
*** Bug 118453 has been marked as a duplicate of this bug. ***
Comment 14 Kevin Vandersloot 2003-07-28 14:52:47 UTC
Kjartan: Go ahead and commit to the gnome-2-2 branch.
Comment 15 Kjartan Maraas 2003-09-02 21:55:25 UTC
Hmm. I guess there's no new format in there I was just looking at it
with no acpi modules loaded. Anyway, I still can't get the actual
battery info while using ACPI here. Where is it supposed to be stored?
Comment 16 Kjartan Maraas 2003-10-05 23:12:35 UTC
More of my confusion wrt ACPI. Closing as fixed.