Activity log for bug #1750013

Date Who What changed Old value New value Message
2018-02-16 18:06:20 Guilherme G. Piccoli bug added bug
2018-02-16 20:38:41 Guilherme G. Piccoli systemd (Ubuntu): importance Undecided Medium
2018-02-16 20:38:41 Guilherme G. Piccoli systemd (Ubuntu): status New In Progress
2018-02-16 20:38:53 Guilherme G. Piccoli nominated for series Ubuntu Trusty
2018-02-16 20:48:11 Guilherme G. Piccoli nominated for series Ubuntu Xenial
2018-02-16 20:48:11 Guilherme G. Piccoli nominated for series Ubuntu Bionic
2018-02-16 20:48:11 Guilherme G. Piccoli nominated for series Ubuntu Artful
2018-02-16 20:50:22 Dan Streetman bug task added systemd (Ubuntu Artful)
2018-02-16 20:50:27 Dan Streetman bug task added systemd (Ubuntu Bionic)
2018-02-16 20:50:31 Dan Streetman bug task added systemd (Ubuntu Trusty)
2018-02-16 20:50:36 Dan Streetman bug task added systemd (Ubuntu Xenial)
2018-02-16 22:07:02 Guilherme G. Piccoli systemd (Ubuntu Trusty): importance Undecided Medium
2018-02-16 22:07:02 Guilherme G. Piccoli systemd (Ubuntu Trusty): status New In Progress
2018-02-16 22:07:02 Guilherme G. Piccoli systemd (Ubuntu Trusty): assignee Guilherme G. Piccoli (gpiccoli)
2018-02-16 22:07:14 Guilherme G. Piccoli systemd (Ubuntu Xenial): importance Undecided Medium
2018-02-16 22:07:14 Guilherme G. Piccoli systemd (Ubuntu Xenial): status New Fix Released
2018-02-16 22:07:14 Guilherme G. Piccoli systemd (Ubuntu Xenial): assignee Guilherme G. Piccoli (gpiccoli)
2018-02-16 22:07:25 Guilherme G. Piccoli systemd (Ubuntu Bionic): status In Progress Fix Released
2018-02-16 22:07:37 Guilherme G. Piccoli systemd (Ubuntu Artful): importance Undecided Medium
2018-02-16 22:07:37 Guilherme G. Piccoli systemd (Ubuntu Artful): status New Fix Released
2018-02-16 22:07:37 Guilherme G. Piccoli systemd (Ubuntu Artful): assignee Guilherme G. Piccoli (gpiccoli)
2018-02-28 14:26:58 Guilherme G. Piccoli description It was observed that systemd-logind tool is leaking memory at each session connected. The issue happens in systemd from Trusty (14.04), which latest version currently (Feb/2018) is 204-5ubuntu20.26 (and still reproduces the bug). The basic test-case is to run the following loop from a remote machine: while true; do ssh <hostname-target> "whoami"; done and watch the increase in memory consumption from "systemd-logind" process in the target machine. One can use the "ps uax" command to verify the RSS of the process, or count the anon pages from /proc/<logind_pid>/smaps. To clarify a bit how a session works, the following "stack trace" details a bit which function calls happen when a SSH connection is opened, from Trusty's systemd-logind point of view: main() <logind.c> manager_startup() manager_run() [event-loop] bus_loop_dispatch() <dbus-loop.c> dbus_watch_handle() -> bus_manager_message_handler() bus_manager_create_session() manager_add_session() <logind.c> session_new() <logind-session.c> session_create_fifo() session_start() session_create_cgroup() session_save() session_bus_path() [...] After each session is closed, it was observed that session_free() isn't called, keeping the sessions alive. This can be verified through the command "loginctl list-session" - each session that once connected is present there "forever". The memory leaks can eventually lead to OOM situation of this process. Debug progress will be tracked here, in this LP. Below the SRU request form. Please refer to the Original Description to a more comprehensive explanation of the problem observed. [Impact] * systemd-logind tool is leaking memory at each session connected. The issues happens in systemd from Trusty (14.04) only. * Three issues observed: - systemd-logind is leaking entire sessions, i.e, the sessions are not feeed after they're closed. In order to fix that, we proactively add the sessions to systemd garbage collector (gc) when they are closed. Also, part of the fix is to make cgmanager package a dependency. Refer to comment #1 to a more thorough explanation of the issue and the fix. - a small memory leak was observed in the session creation logic of systemd-logind. The fix for that is the addition of an appropriate free() call. Refer to comment #2 to more details on the issue and fix. - another small memory leak was observed in the cgmanager glue code of systemd-logind - this code is only present in this specific Ubuntu release of the package, due to necessary compatibility layer with upstart init system. The fix is to properly call free() in 2 functions. Refer to comment #3 to a deep exposition of the issue and the fix. [Test Case] * The basic test-case is to run the following loop from a remote machine: while true; do ssh <hostname-target> "whoami"; done * It's possible to watch the increase in memory consumption from "systemd-logind" process in the target machine. One can use the "ps uax" command to verify the RSS of the process, or count its anonymous pages from /proc/<logind_pid>/smaps. [Regression Potential] * Since the fixes are small and not intrusive, the potential for regressions are low. More regression considerations on comments #1, #2 and #3 for each fix. * A potential small regressson is performance-wise, since now we add sessions to garbage collector proactively.
2018-02-28 14:28:21 Guilherme G. Piccoli tags sts sts sts-sru-needed
2018-02-28 14:32:11 Guilherme G. Piccoli attachment added debdiff https://bugs.launchpad.net/ubuntu/artful/+source/systemd/+bug/1750013/+attachment/5065280/+files/lp1750013-trusty.debdiff
2018-02-28 14:33:00 Guilherme G. Piccoli bug added subscriber STS Sponsors
2018-03-02 19:33:19 Guilherme G. Piccoli attachment added debdiff v2 https://bugs.launchpad.net/ubuntu/artful/+source/systemd/+bug/1750013/+attachment/5067376/+files/lp1750013-trusty_v2.debdiff
2018-03-08 19:13:40 Brian Murray systemd (Ubuntu Trusty): status In Progress Fix Committed
2018-03-08 19:13:43 Brian Murray bug added subscriber Ubuntu Stable Release Updates Team
2018-03-08 19:13:44 Brian Murray bug added subscriber SRU Verification
2018-03-08 19:13:49 Brian Murray tags sts sts-sru-needed sts sts-sru-needed verification-needed verification-needed-trusty
2018-03-09 13:37:37 Guilherme G. Piccoli tags sts sts-sru-needed verification-needed verification-needed-trusty sts verification-done verification-done-trusty
2018-03-12 12:23:57 Guilherme G. Piccoli tags sts verification-done verification-done-trusty regression-proposed sts verification-done verification-done-trusty
2018-04-01 20:52:46 Mauro Franzoni attachment added trace-cgman.txt https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1750013/+attachment/5098334/+files/trace-cgman.txt
2018-04-01 20:55:53 Mauro Franzoni attachment added trace-syslog.txt https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1750013/+attachment/5098335/+files/trace-syslog.txt
2018-04-03 17:54:43 Guilherme G. Piccoli attachment added lp1750013-trusty_v3.debdiff https://bugs.launchpad.net/ubuntu/artful/+source/systemd/+bug/1750013/+attachment/5100204/+files/lp1750013-trusty_v3.debdiff
2018-04-03 17:56:14 Guilherme G. Piccoli tags regression-proposed sts verification-done verification-done-trusty sts sts-sru-needed
2018-04-12 10:03:23 Łukasz Zemczak tags sts sts-sru-needed sts sts-sru-needed verification-needed verification-needed-trusty
2018-04-12 17:05:49 Guilherme G. Piccoli tags sts sts-sru-needed verification-needed verification-needed-trusty sts verification-done verification-done-trusty
2018-04-19 16:53:55 Łukasz Zemczak removed subscriber Ubuntu Stable Release Updates Team
2018-04-19 17:04:10 Launchpad Janitor systemd (Ubuntu Trusty): status Fix Committed Fix Released