gsd-housekeeping leaks file descriptors

Bug #1745666 reported by Janne Snabb on 2018-01-26
84
This bug affects 17 people
Affects Status Importance Assigned to Milestone
gnome-settings-daemon (Ubuntu)
Undecided
Unassigned

Bug Description

Apparently a process called gsd-housekeeping is periodically invoked on my Ubuntu 17.10 system. It traverses my /var/tmp for some reason. Looks like it is leaking file descriptors while doing so.

My syslogs are full of error messages like the following:

Jan 26 20:21:42 snail gsd-housekeepin[3178]: Failed to enumerate children of /var/tmp/chmaa-backup/usr/include/c++/5/bits/stl_raw_storage_iter.h: Error opening directory '/var/tmp/chmaa-backup/usr/include/c++/5/bits/stl_raw_storage_iter.h': Too many open files
Jan 26 20:21:42 snail gsd-housekeepin[3178]: Failed to enumerate children of /var/tmp/chmaa-backup/usr/include/c++/5/bits/basic_string.h: Error opening directory '/var/tmp/chmaa-backup/usr/include/c++/5/bits/basic_string.h': Too many open files
Jan 26 20:21:42 snail gsd-housekeepin[3178]: Failed to enumerate children of /var/tmp/chmaa-backup/usr/include/c++/5/bits/quoted_string.h: Error opening directory '/var/tmp/chmaa-backup/usr/include/c++/5/bits/quoted_string.h': Too many open files
Jan 26 20:21:42 snail gsd-housekeepin[3178]: Failed to enumerate children of /var/tmp/chmaa-backup/usr/include/c++/5/bits/postypes.h: Error opening directory '/var/tmp/chmaa-backup/usr/include/c++/5/bits/postypes.h': Too many open files
Jan 26 20:21:42 snail gsd-housekeepin[3178]: Failed to enumerate children of /var/tmp/chmaa-backup/usr/include/c++/5/bits/stl_iterator.h: Error opening directory '/var/tmp/chmaa-backup/usr/include/c++/5/bits/stl_iterator.h': Too many open files
Jan 26 20:21:42 snail gsd-housekeepin[3178]: Failed to enumerate children of /var/tmp/chmaa-backup/usr/include/c++/5/bits/move.h: Error opening directory '/var/tmp/chmaa-backup/usr/include/c++/5/bits/move.h': Too many open files

$ lsb_release -rd
Description: Ubuntu 17.10
Release: 17.10

$ apt policy gnome-settings-daemon
gnome-settings-daemon:
  Installed: 3.26.2-0ubuntu0.1
  Candidate: 3.26.2-0ubuntu0.1
  Version table:
 *** 3.26.2-0ubuntu0.1 500
        500 http://se.archive.ubuntu.com/ubuntu artful-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     3.26.1-0ubuntu5 500
        500 http://se.archive.ubuntu.com/ubuntu artful/main amd64 Packages

dino99 (9d9) wrote :

Also seen on Bionic with a gnome xorg session.

tags: added: artful bionic
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-settings-daemon (Ubuntu):
status: New → Confirmed
Dark.Crow (d+rkcrow) wrote :

on Bionic gnome too, for me it says:

gsd-housekeepin[983]: Failed to enumerate children of /tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-rtkit-daemon.service-Dq1Pd4: Error opening directory '/tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-rtkit-daemon.service-Dq1Pd4': Permission denied
Mar 14 21:02:06 nx7400 gsd-housekeepin[983]: Failed to enumerate children of /tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-colord.service-7OoC3b: Error opening directory '/tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-colord.service-7OoC3b': Permission denied
Mar 14 21:02:06 nx7400 gsd-housekeepin[983]: Failed to enumerate children of /var/tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-colord.service-Ydr791: Error opening directory '/var/tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-colord.service-Ydr791': Permission denied
Mar 14 21:02:06 nx7400 gsd-housekeepin[983]: Failed to enumerate children of /tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-systemd-resolved.service-R5QQbf: Error opening directory '/tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-systemd-resolved.service-R5QQbf': Permission denied
Mar 14 21:02:06 nx7400 gsd-housekeepin[983]: Failed to enumerate children of /var/tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-ntp.service-Sms3zf: Error opening directory '/var/tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-ntp.service-Sms3zf': Permission denied
Mar 14 21:02:06 nx7400 gsd-housekeepin[983]: Failed to enumerate children of /tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-ntp.service-FS65FP: Error opening directory '/tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-ntp.service-FS65FP': Permission denied
Mar 14 21:02:06 nx7400 gsd-housekeepin[983]: Failed to enumerate children of /var/tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-rtkit-daemon.service-8OSzh6: Error opening directory '/var/tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-rtkit-daemon.service-8OSzh6': Permission denied
Mar 14 21:02:06 nx7400 gsd-housekeepin[983]: Failed to enumerate children of /var/tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-systemd-resolved.service-qSrjak: Error opening directory '/var/tmp/systemd-private-babe9614aa12489a9f2fc7347580de0b-systemd-resolved.service-qSrjak': Permission denied
... and goes on and on..

I eased access to tmp and /var/tmp dir's to rwxrwxr.. (not recursive) for the both, maybe it helps.
..earlier in the day this made my laptop reboot.

hope it helps.

dino99 (9d9) wrote :

With gsd 3.28.0-0ubuntu1 on bionic, the errors are like:

gsd-housekeepin[1538]: Failed to enumerate children of /var/tmp/systemd-private-*-daemon.service-*:
Error opening directory '/var/tmp/systemd-private*-daemon.service-*': Permission denied

Janne Snabb (snabb) wrote :

Temporary workaround:

1) sudo mv /usr/lib/gnome-settings-daemon/gsd-housekeeping /usr/lib/gnome-settings-daemon/gsd-housekeeping.off
2) logout and login

This needs to be redone when "gnome-settings-daemon" package is updated.

I do not know if it is doing something useful for some people. Personally I feel this is some useless service which should be optional and disabled by default. I do not want or need some unknown software traversing my filesystem. I am worried about the potential privacy issues as the system logs now contain file system contents listing. The logs may be accidentally shipped outside my system for example when submitting bug reports. And it also causes system load while doing it. I have never asked it to do so!

dino99 (9d9) wrote :

The errors as of #4 are still seen

Janne Snabb (snabb) wrote :

Also affects Ubuntu 18.04 bionic (beta2 right now).

$ apt policy gnome-settings-daemon
gnome-settings-daemon:
  Installed: 3.28.0-0ubuntu2
  Candidate: 3.28.0-0ubuntu2
  Version table:
 *** 3.28.0-0ubuntu2 500
        500 http://se.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status

Same here, for Permission Denied, on Bionic. Occurs once every hour.

Anders Hall (a.hall) wrote :

I think this bug i filed might be a duplicate of this: https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1795111

In my case i could detect that the desktop became unresponsive as well.

Anders Hall (a.hall) wrote :

I'm fairly sure this is related to changes in fs.inotify.max_user_watches ("Too many open files"). I recently got a bunch of warnings in misc code editors about low values. Took me a while to understand the max_user_watches had reverted back to the default value of about 8000. I.e., some update probably changed my setting, which was much higher before, without permission. I haven't touched that setting for years.

This could perhaps also affect large dropbox folders.

Pro/Cons of a higher value:
https://unix.stackexchange.com/questions/13751/kernel-inotify-watch-limit-reached

Currently testing this workaround:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Anders Hall (a.hall) wrote :

Nope, the message persists even with fs.inotify.max_user_watches=524288

Total nr messages:
# journalctl -m | grep gsd-housekeepin | wc -l
1947297

Previous nr boot messages (no reboot after workaround was applied, could be weeks):
#journalctl -b | grep gsd-housekeepin | wc -l
51500

Current nr boot messages (about 1 day after the workaround was applied and a reboot was performed):
#journalctl -b | grep gsd-housekeepin | wc -l
6000

Anders Hall (a.hall) wrote :

In 15 hours 6000 new messages occur.
#journalctl -b | grep gsd-housekeepin | wc -l
12000

The permission on /var/tmp
drwxrwxrwt 45 root root 56K okt 1 14:53 tmp/

The permissions on mkinitramfs stuff in /var/tmp
drwxr-xr-x 12 root root 4,0K jan 21 2017 mkinitramfs_NNARsN/
-rw------- 1 root root 0 jan 12 2017 mkinitramfs-OL_3YeMt7

The permissions on systemd stuff in /var/tmp
ll /var/tmp/systemd-private-b45aa528188d4cb180453f35adbfd14c-systemd-resolved.service-ceueNy/
total 68K
drwx------ 3 root root 4,0K okt 1 14:52 ./
drwxrwxrwt 45 root root 56K okt 1 14:53 ../
drwxrwxrwt 2 root root 4,0K okt 1 14:52 tmp/

Will try changing permissions next.

Anders Hall (a.hall) wrote :

#journalctl -b | grep gsd-housekeepin | wc -l
100067

Going for #5 by Janne since nothing else works (annoying task to keep performing). It is also the suggestion by Fedora maintainers as systemd does the same task of cleaning tmp (https://bugzilla.redhat.com/show_bug.cgi?id=1563445)

Upstream reports:
https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/26

Innealtoir (innealtoir) wrote :
Download full text (4.0 KiB)

I just tried to report this bug for Bionic, it informed me the package was not installed when i used fn+alt f2 ubuntu-bug gsd-housekeepin.

I have changed the computer name in the output but had a privlige issue
Oct 10 01:47:36 Ze-C00mp7er-Name-Duh kernel: [79249.397167] [UFW BLOCK]...
Oct 10 01:48:00 Ze-C00mp7er-Name-Duh gsd-housekeepin[1697]: Failed to enumerate children of /var/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-fwupd.service-mpR5zs: Error opening directory '/var/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-fwupd.service-mpR5zs': Permission denied
Oct 10 01:48:00 Ze-C00mp7er-Name-Duh gsd-housekeepin[1697]: Failed to enumerate children of /var/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-rtkit-daemon.service-OpMdvp: Error opening directory '/var/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-rtkit-daemon.service-OpMdvp': Permission denied
Oct 10 01:48:00 Ze-C00mp7er-Name-Duh gsd-housekeepin[1697]: Failed to enumerate children of /var/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-colord.service-iqprAr: Error opening directory '/var/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-colord.service-iqprAr': Permission denied
Oct 10 01:48:00 Ze-C00mp7er-Name-Duh gsd-housekeepin[1697]: Failed to enumerate children of /var/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-bolt.service-ieEFMJ: Error opening directory '/var/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-bolt.service-ieEFMJ': Permission denied
Oct 10 01:48:00 Ze-C00mp7er-Name-Duh gsd-housekeepin[1697]: Failed to enumerate children of /var/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-systemd-resolved.service-ckArYi: Error opening directory '/var/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-systemd-resolved.service-ckArYi': Permission denied
Oct 10 01:48:00 Ze-C00mp7er-Name-Duh gsd-housekeepin[1697]: Failed to enumerate children of /var/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-systemd-timesyncd.service-CdKRqO: Error opening directory '/var/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-systemd-timesyncd.service-CdKRqO': Permission denied
Oct 10 01:48:00 Ze-C00mp7er-Name-Duh gsd-housekeepin[1697]: Failed to enumerate children of /tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-fwupd.service-Bmog5W: Error opening directory '/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-fwupd.service-Bmog5W': Permission denied
Oct 10 01:48:00 Ze-C00mp7er-Name-Duh gsd-housekeepin[1697]: Failed to enumerate children of /tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-colord.service-FegyGA: Error opening directory '/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-colord.service-FegyGA': Permission denied
Oct 10 01:48:00 Ze-C00mp7er-Name-Duh gsd-housekeepin[1697]: Failed to enumerate children of /tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-bolt.service-1zMUMT: Error opening directory '/tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-bolt.service-1zMUMT': Permission denied
Oct 10 01:48:00 Ze-C00mp7er-Name-Duh gsd-housekeepin[1697]: Failed to enumerate children of /tmp/systemd-private-6465a9cfaab745e3be21bfacf5191d7d-rtkit-daemon.service-PGWz5B: Error opening directory '/tmp/systemd-...

Read more...

Anders Hall (a.hall) wrote :

Problem exist in 18.10 as well after upgrade.

lotuspsychje (lotuspsychje) wrote :

The same is happening on 18.04.1 kernel 4.15.0-39-generic @ 15/11/2018

Luke Horstman (ljh48332) wrote :

Same issue here. Ubuntu 18.04 Kernel4.15.0-42-generic Dec 06 2018

Failed to enumerate children of /tmp/systemd-private-42045536c330493292b9e62a860928e4-fwupd.service-GNaXSl: Error opening directory '/tmp/systemd-private-42045536c330493292b9e62a860928e4-fwupd.service-GNaXSl': Permission denied

Luke Horstman (ljh48332) wrote :

I'm not sure if this is related or if this helps troubleshoot, but my system will randomly go unresponsive and needs to be hard rebooted. May or may not be related to this bug.

Anders Hall (a.hall) wrote :

This bug came back in recent updated after using workaround #5 by Janne. Didn't notice at first, then severe system slowdowns and odd power behaviour started to occur. 100% Fan on etc. Killing my disk long term as well. I detected it when the gsd-housekeepin service crashed and Ubuntu notified this.

Why is no one fixing this? Just remove the whole service permanently, it has no real value as stated upstream. Linux computer 4.18.0-13-generic #14-Ubuntu SMP Wed Dec 5 09:04:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Anders Hall (a.hall) wrote :

This bug came back again in latest ubuntu, this time a new symptom occurred. Gnome extensions are also regularly disabled for some reason. Removing gsd-housekeepin still works.

Anders Hall (a.hall) wrote :

@snabb (Janne) #7 or @ljh48332 (Luke) just detected this again in latest release and will present a workaround that solves it even with continuous Ubuntu/Debian/Gnome updates. Could you give some insight into why this service is kept and not removed completely? Even the Gnome threads state it should be removed. Most people probably are not aware of the problem but it is a severe bug from a performance, data integrity and hardware perspective.

demon (fyredemonyte) wrote :

I believe this is the solution until they fix the service:

Go to to System Settings > Privacy and toggle off Purge Trash and Temporary Files.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.