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 784493 - g-s-d crashes due to FD leak in tmp-cleaner
g-s-d crashes due to FD leak in tmp-cleaner
Status: RESOLVED OBSOLETE
Product: gnome-settings-daemon
Classification: Core
Component: housekeeping
3.22.x
Other Linux
: Normal critical
: ---
Assigned To: Richard Hughes
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2017-07-03 22:32 UTC by Laurent Bigonville
Modified: 2019-03-20 11:45 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Laurent Bigonville 2017-07-03 22:32:24 UTC
Hi,

We go teh following bugreport in debian:

====

I noticed that gnome-settings-daemon regularly crashes and restarts
on my system.

I investigated this with gdb and got the following backtrace:

  • #0 _g_log_abort
    at ././glib/gmessages.c line 487
  • #1 g_log_default_handler
    at ././glib/gmessages.c line 2816
  • #2 g_logv
    at ././glib/gmessages.c line 1275
  • #3 g_log
    at ././glib/gmessages.c line 1337
  • #4 g_wakeup_new
    at ././glib/gwakeup.c line 161
  • #5 g_main_context_new
    at ././glib/gmain.c line 656
  • #6 g_dbus_connection_send_message_with_reply_sync
    at ././gio/gdbusconnection.c line 2138
  • #7 g_dbus_connection_call_sync_internal
    at ././gio/gdbusconnection.c line 5935
  • #8 g_dbus_connection_call_with_unix_fd_list_sync
    at ././gio/gdbusconnection.c line 6281
  • #9 g_dbus_proxy_call_sync_internal
    at ././gio/gdbusproxy.c line 2857
  • #10 g_dbus_proxy_call_sync
    at ././gio/gdbusproxy.c line 3049
  • #11 0x00007f00dc267248 in
  • #12 0x00007f00dc2640de in
  • #13 0x00007f00dc24e685 in
  • #14 g_local_file_delete
    at ././gio/glocalfile.c line 1551
  • #15 delete_subdir
    at gsd-disk-space.c line 383
  • #16 g_task_return_now
    at ././gio/gtask.c line 1121
  • #17 complete_in_idle_cb
    at ././gio/gtask.c line 1135
  • #18 g_main_dispatch
    at ././glib/gmain.c line 3203
  • #19 g_main_context_dispatch
    at ././glib/gmain.c line 3856
  • #20 g_main_context_iterate
    at ././glib/gmain.c line 3929
  • #21 g_main_loop_run
    at ././glib/gmain.c line 4125
  • #22 gtk_main
  • #23 main

Examining frame #14:

(gdb) print *local
$1 = {parent_instance = {g_type_instance = {g_class = 0x7f00d000be10}, 
    ref_count = 2, qdata = 0x0}, 
  filename = 0xc5dfa0 "/var/tmp/0QI_OkZMk7/linux-3.16.36/debian/linux-image-3.16.0-4-m68k.templates"}

So gnome-settings-daemon is cleaning up /var/tmp.  That is a useful
function, but this behaviour is not documented anywhere.  It is *not*
normal for /var/tmp to be cleaned up automatically so this is a bug.

Now, why is it crashing?  The log format string (which never actually
makes it into the log - that seems a bug in _g_log_abort()) - is
"Creating pipes for GWakeup: %s".  The only likely reason for pipe
creation failure is a limit on number of FDs.  Sure enough, this
process has 1024 FDs open, mostly for directories under /var/tmp.
That looks like an FD leak.

Ben.

====


https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=851498
Comment 1 Michael Catanzaro 2017-07-12 01:37:21 UTC
I think we need to change the housekeeping plugin to enable/disable systemd-tmpfiles-clean.timer. Then we can delete all this code, and that will solve the problem of systemd deleting all your temporary files even if you've configured GNOME not to. Plus, systemd reads /usr/lib/tmpfiles.d, so it cleans lots of application-specific tmp directories.

But yes, the fd leak is bad....
Comment 2 Michael Catanzaro 2017-07-12 01:39:55 UTC
Thanks for the good bug report, by the way. (Or, well, for forwarding it.)
Comment 3 Laurent Bigonville 2017-07-12 12:26:52 UTC
Delegating the job to systemd timer will break the non-linux usecase.

Also, the systemd-tmpfiles-clean.timer is system-wise while g-s-d is per user, how are you planning to manage that?

FTR in debian tmpfiles/systemd is apparently not cleaning /var/tmp automatically, but this seems to be the expected behavior according to the bug report
Comment 4 Michael Catanzaro 2017-07-12 14:59:52 UTC
(In reply to Laurent Bigonville from comment #3)
> Delegating the job to systemd timer will break the non-linux usecase.

Oh no....

> Also, the systemd-tmpfiles-clean.timer is system-wise while g-s-d is per
> user, how are you planning to manage that?

This is the real problem, there would be no way to clean the user's trash.

> FTR in debian tmpfiles/systemd is apparently not cleaning /var/tmp
> automatically, but this seems to be the expected behavior according to the
> bug report

It's off by default in Fedora, too.
Comment 5 GNOME Infrastructure Team 2019-03-20 11:45:22 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/345.