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 638335 - gdbus leaks file descriptors
gdbus leaks file descriptors
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gdbus
unspecified
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-12-30 10:52 UTC by Philippe Rouquier
Modified: 2017-10-26 10:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
valgrind log (4.07 KB, text/plain)
2010-12-30 10:52 UTC, Philippe Rouquier
  Details
possible patch (3.62 KB, patch)
2011-02-16 01:17 UTC, Matthias Clasen
none Details | Review

Description Philippe Rouquier 2010-12-30 10:52:30 UTC
Created attachment 177249 [details]
valgrind log

While developping a program of mine and running it through valgrind, I noticed that when a GCancellable object is passed as an argument to g_socket_create_source(), that function leaks a file descriptor.
The problem is that this function is used internally in Glib as it is shown by the excerpt from the valgrind log (especially in the GSocketService object) and therefore there is not workaround for these cases.
Comment 1 Dan Winship 2011-01-03 15:59:42 UTC
The quoted valgrind output is ambiguous, but it's probably gdbus that's doing the leaking. (Maybe leaking the GSource?)
Comment 2 Matthias Clasen 2011-02-16 01:17:42 UTC
Created attachment 180957 [details] [review]
possible patch

Here is a possible patch that survives make check just fine. Does this make the observed leaks go away ?
Comment 3 Matthias Clasen 2012-07-06 03:23:49 UTC
Patch review would still be appreciated here
Comment 4 David Zeuthen (not reading bugmail) 2012-07-06 13:11:43 UTC
Does the patch still apply and does the problem still exist? I remember Simon changed a lot of this code late last year (your patch is from early last year), see

 http://git.gnome.org/browse/glib/log/gio/gdbusprivate.c
Comment 5 Philip Withnall 2017-10-26 10:29:17 UTC
This has almost certainly been fixed in the last 5 years: GCancellable now uses set_ready_time() rather than an FD (bug #724707), and gdbusprivate.c has been rewritten to use g_task_attach_source(). Having read through the code, I can’t see any obvious leaks.