GNOME Bugzilla – Bug 638335
gdbus leaks file descriptors
Last modified: 2017-10-26 10:29:17 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.
The quoted valgrind output is ambiguous, but it's probably gdbus that's doing the leaking. (Maybe leaking the GSource?)
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 ?
Patch review would still be appreciated here
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
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.