systemd pid 1 memory leak
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Low
|
Dan Streetman |
Bug Description
[impact]
pid1 leaks memory when rebuilding unit path cache
[test case]
see original description.
also, the patch contains an example of how to reproduce:
$ for i in {1..300}; do cp ~/.config/
[regression]
any problems would occur when rebuilding the path cache, possibly resulting in memory leaks or pid1 crashes.
[scope]
this is needed only in f
fixed upstream by 3fb2326f3ed87aa
the code in b is very different and doesn't appear to have the leak, per original report
[original description]
Hi everybody.
We've meet a memory leak of pid1 process on the focal release.
When we launch chef-client, several systemd .service and .timers are checked for state.
Every time of this run pid1 increase VSZ/RSS on ~ 232 Kb, this don't happen on xenial and bionic releases.
I straced pid1 when that leak happen and found brk call.
On pmap view of pid 1 it's anon memory grow on the same address and all marked as dirty.
All that leak memory can be freed by calling systemctl daemon-reexec.
Searching in systemd github repo i found this commit https:/
-------
Environment:
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
Uname: 5.4.0-77-generic #83-Ubuntu SMP Sat May 8 02:35:39 UTC 2021 x86_64
Package:
systemd:
Installed: 245.4-4ubuntu3.7
description: | updated |
tags: | added: pid1 |
description: | updated |
Changed in systemd (Ubuntu): | |
status: | New → Fix Released |
Changed in systemd (Ubuntu Focal): | |
status: | New → In Progress |
importance: | Undecided → Low |
assignee: | nobody → Dan Streetman (ddstreet) |
tags: |
added: verification-done removed: verification-needed |
Just checked again, bug still exist for latest systemd package on focal.
# apt-cache policy systemd
systemd:
Installed: 245.4-4ubuntu3.11