GNOME Bugzilla – Bug 784493
g-s-d crashes due to FD leak in tmp-cleaner
Last modified: 2019-03-20 11:45:22 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:
+ Trace 237613
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
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....
Thanks for the good bug report, by the way. (Or, well, for forwarding it.)
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
(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.
-- 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.