Skip to content

fix memory increase by not send login-history via dbus

Memory of 3 processes (accounts-daemon, gdm-session-worker, gnome-shell) increase
when repeat ssh login/logout.
This problem was discovered by testing system of using Ansible.

This is result of repeat ssh login/logout every second for 2 days. pslog_fc29_git_2days.txt

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
===== 1 times (Mon Dec  3 15:16:31 JST 2018)=====
root       585  0.0  0.1 456876  7964 ?        Ssl  15:15   0:00 /usr/libexec/accounts-daemon
root       987  0.0  0.2 401940 11796 ?        Sl   15:16   0:00 gdm-session-worker [pam/gdm-password]
root      1092 27.9  6.0 2463880 244764 tty2   Rl+  15:16   0:06 /usr/bin/gnome-shell

-> 2days later

===== 49 times (Wed Dec  5 15:16:33 JST 2018)=====
root       585 45.5  8.6 780780 348916 ?       Rsl  Dec03 1312:02 /usr/libexec/accounts-daemon
root       987 16.2  4.4 558696 179724 ?       Sl   Dec03 469:00 gdm-session-worker [pam/gdm-password]
root      1092 20.2 10.2 2625012 412528 tty2   Rl+  Dec03 581:59 /usr/bin/gnome-shell
  • Environment : ssh login from RHEL 7.3 to Fedora29(git ver of accounts-service)

Reproduction

Repeat ssh login/logout by using attached script autologin.sh autologin.shget_pslog.sh
You can see RSS increase even just 10 minutes.


Reproduction Immediately

I attached /var/log/wtmp file which was created by repeat ssh login/logout for 2 days. wtmp_2days.gzwtmp_5days.gz
Only copy to /var/log/wtmp.
This is pseudo, not the complete same result (especially RSS of accounts-daemon),
but the way to see RSS increase immediately.

# rm /var/log/wtmp
# reboot
# ps aux | grep -e accounts-daemon -e gdm-session-worker -e gnome-shell
# gunzip /tmp/wtmp.gz
# cp /tmp/wtmp /var/log/
# ps aux | grep -e accounts-daemon -e gdm-session-worker -e gnome-shell

If you want to see/edit wtmp, please use utmpdump command.

# utmpdump /tmp/wtmp > /tmp/wtmp.txt
# vi /tmp/wtmp.txt
# utmpdump -r < /tmp/wtmp.txt > /tmp/wtmp

Patch

This memory increase is occured by this patch.
This patch makes send login-history via dbus in result.
https://bugs.freedesktop.org/show_bug.cgi?id=106162
https://bugs.freedesktop.org/attachment.cgi?id=138961
commit e18e8a3a

So, I reverts above patch about login-history only.
This is result of patched accountsservice.pslog_fc29_git_patched_2days.txt

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
===== 1 times (Mon Dec  3 09:55:35 JST 2018)=====
root       588  0.0  0.1 456884  7840 ?        Ssl  09:54   0:00 /usr/libexec/accounts-daemon
root       990  0.0  0.2 401936 11792 ?        Sl   09:54   0:00 gdm-session-worker [pam/gdm-password]
root      1094 13.8  6.0 2464904 244084 tty2   Rl+  09:54   0:08 /usr/bin/gnome-shell

-> 2days later

===== 49 times (Wed Dec  5 09:55:38 JST 2018)=====
root       588 56.2  7.9 766584 319868 ?       Rsl  Dec03 1621:32 /usr/libexec/accounts-daemon
root       990  0.0  0.2 401936 11872 ?        Sl   Dec03   0:39 gdm-session-worker [pam/gdm-password]
root      1094  2.3  6.3 2479028 255900 tty2   Sl+  Dec03  67:25 /usr/bin/gnome-shell

Merge request reports