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 121170 - Slow file handle leak
Slow file handle leak
Status: RESOLVED FIXED
Product: gnome-applets
Classification: Other
Component: gweather
2.3.x
Other Linux
: High critical
: ---
Assigned To: gnome-applets Maintainers
gnome-applets Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-09-01 12:41 UTC by alan
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.3/2.4


Attachments
leak fix in gweather (gnome-vfs) (3.57 KB, patch)
2003-09-09 13:56 UTC, Kjartan Maraas
none Details | Review

Description alan 2003-09-01 12:41:07 UTC
I wondered where all my file handles were going after updating to Red Hat
rawhide. On this I see gweather uses a lot of file handles initially (it
has some 35 open and four threads). It also adds one handle per refresh it
does (trigger a reload with the menu you'll see the same)
Comment 1 Elijah Newren 2003-09-01 17:19:20 UTC
I saw the same behavior with my GNOME CVS installation (upon seeing
this bug report, I decided to test it out).  Note that, for some
reason, the weather wasn't coming up at the time (I guess the main
server was down or something?).  However, my installation was somewhat
old, so I decided to compile the most recent gnome-applet module from
CVS.  Once I was able to do that, it appears that the weather was able
to appear (main server came back up?).  At that point, I was no longer
able to reproduce this bug.  I don't know if this bug is a "This has
been fixed in newer versions" or a "There's a file leak when the
weather can't be obtained."

I'm just going to update the report and add the bugsquad keyword and
let someone else figure it out.
Comment 2 Kevin Vandersloot 2003-09-09 13:23:55 UTC
Alan: which version of gnome-applets is used in rawhide?
Comment 3 Kjartan Maraas 2003-09-09 13:39:57 UTC
2.3.7-1 is the current version.
Comment 4 Kjartan Maraas 2003-09-09 13:55:28 UTC
From valgrind I see the following leaks reported:

==18596== 400 bytes in 35 blocks are definitely lost in loss record
114 of 195
==18596==    at 0x400128C6: calloc (vg_replace_malloc.c:273)
==18596==    by 0x8F094E: g_malloc0 (in /usr/lib/libglib-2.0.so.0.200.3)
==18596==    by 0x9743EF: gnome_vfs_socket_new (in
/usr/lib/libgnomevfs-2.so.0.3 00.90)
==18596==    by 0x9616F8: gnome_vfs_inet_connection_to_socket (in
/usr/lib/libgn omevfs-2.so.0.300.90)
==18596==    by 0x43847CEC: (within
/usr/lib/gnome-vfs-2.0/modules/libhttp.so)
==18596==    by 0x43847FE5: (within
/usr/lib/gnome-vfs-2.0/modules/libhttp.so)
==18596==    by 0x4384834E: (within
/usr/lib/gnome-vfs-2.0/modules/libhttp.so)
==18596==    by 0x95BD6B: gnome_vfs_open_uri_cancellable (in
/usr/lib/libgnomevf s-2.so.0.300.90)
==18596==    by 0x963BD7: (within /usr/lib/libgnomevfs-2.so.0.300.90)
==18596==    by 0x964AA8: _gnome_vfs_job_execute (in
/usr/lib/libgnomevfs-2.so.0 .300.90)
==18596==    by 0x9623C8: (within /usr/lib/libgnomevfs-2.so.0.300.90)
==18596==    by 0x9748BD: (within /usr/lib/libgnomevfs-2.so.0.300.90)
==18596==    by 0x9028F0: (within /usr/lib/libglib-2.0.so.0.200.3)
==18596==    by 0x4023F571: thread_wrapper (vg_libpthread.c:667)
==18596==    by 0x4015CF04: do__quit (vg_scheduler.c:2146)
==18596==

This one I haven't taken a shot at fixing yet.

And:

==18596== 746 bytes in 75 blocks are definitely lost in loss record
132 of 195
==18596==    at 0x4001246E: malloc (vg_replace_malloc.c:153)
==18596==    by 0x8F08C6: g_malloc (in /usr/lib/libglib-2.0.so.0.200.3)
==18596==    by 0x8FD760: g_strndup (in /usr/lib/libglib-2.0.so.0.200.3)
==18596==    by 0x8FEA0D: g_ascii_strdown (in
/usr/lib/libglib-2.0.so.0.200.3)
==18596==    by 0x4384762F: (within
/usr/lib/gnome-vfs-2.0/modules/libhttp.so)
==18596==    by 0x43847774: (within
/usr/lib/gnome-vfs-2.0/modules/libhttp.so)
==18596==    by 0x43847B8C: (within
/usr/lib/gnome-vfs-2.0/modules/libhttp.so)
==18596==    by 0x43847FE5: (within
/usr/lib/gnome-vfs-2.0/modules/libhttp.so)
==18596==    by 0x4384834E: (within
/usr/lib/gnome-vfs-2.0/modules/libhttp.so)
==18596==    by 0x95BD6B: gnome_vfs_open_uri_cancellable (in
/usr/lib/libgnomevf s-2.so.0.300.90)
==18596==    by 0x963BD7: (within /usr/lib/libgnomevfs-2.so.0.300.90)
==18596==    by 0x964AA8: _gnome_vfs_job_execute (in
/usr/lib/libgnomevfs-2.so.0 .300.90)
==18596==    by 0x9623C8: (within /usr/lib/libgnomevfs-2.so.0.300.90)
==18596==    by 0x9748BD: (within /usr/lib/libgnomevfs-2.so.0.300.90)
==18596==    by 0x9028F0: (within /usr/lib/libglib-2.0.so.0.200.3)
==18596==    by 0x4023F571: thread_wrapper (vg_libpthread.c:667)
==18596==    by 0x4015CF04: do__quit (vg_scheduler.c:2146)
==18596==

This is possibly fixed by the attatched patch to gnome-vfs.
Comment 5 Kjartan Maraas 2003-09-09 13:56:40 UTC
Created attachment 19825 [details] [review]
leak fix in gweather (gnome-vfs)
Comment 6 Kevin Vandersloot 2003-09-09 14:15:35 UTC
Kjartan: I think you should put your patch and valgrind analysis in a
seperate gnome-vfs bug. I don't think the leaks would be related to
file-handles. The file-handles problem is probably gweathers fault in
how it uses gnome-vfs.
Comment 7 Kjartan Maraas 2003-09-09 22:25:55 UTC
I did. Trying to get to the bottom of the
gnome_vfs_inet_connection_to_socket() leak now to see if that might be
the cause.
Comment 8 Kjartan Maraas 2003-10-05 22:28:54 UTC
Alan, how does this show up on your system? Can you tell me how to
verify that file handles are leaking?
Comment 9 Alan 2003-10-06 22:58:43 UTC
Look in /proc/$pid/fd
Refresh
Repeat.
Comment 10 Kevin Vandersloot 2003-10-07 15:45:25 UTC
This doesn't seem to happen in 2.2.0 following Alan's advice. I think
that the problem came from the experimental gweather that was shipped
in early 2.3.x releases but that eventually had to be reverted to the
normal applet. The 2.4.0 gweather should be pretty much the same as
2.2.0 so I have a feeling that this bug is not valid anymore. 

It would be nice to verify on a 2.4.0 build.
Comment 11 Kjartan Maraas 2003-10-07 20:45:24 UTC
Yeah, I tried monitoring that dir earlier and I had a constant number
of entries in /proc/<pid>/fd
Comment 12 Alan 2003-10-15 20:19:07 UTC
Confirmed - 2.4 revert of old one fixed it