Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1361120

Summary: Memory leaks found in systemd and its subcomponents
Product: Red Hat Enterprise Linux 7 Reporter: Frantisek Sumsal <fsumsal>
Component: systemdAssignee: systemd-maint
Status: CLOSED CURRENTRELEASE QA Contact: Frantisek Sumsal <fsumsal>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: bblaskov, msekleta, neil, systemd-maint-list
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-22 10:22:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
# systemctl disable postfix
none
# systemctl enable postfix
none
# journalctl --no-pager -u system.slice
none
/usr/lib/systemd/systemd-modules-load
none
/usr/lib/systemd/systemd
none
# journalctl --no-pager -u system.slice
none
/usr/lib/systemd/systemd-modules-load
none
/usr/lib/systemd/systemd none

Description Frantisek Sumsal 2016-07-28 11:30:12 UTC
systemd package version: systemd-219-24.el7.x86_64

These memory leaks were found in systemd package already recompiled with -DVALGRIND=1 option. It's worth mentioning that all these commands/binaries were run in an nspawn container.

Issued commands/executed binaries:
1) # systemctl disable postfix
2) # systemctl enable postfix
3) # journalctl --no-pager -u system.slice
4) # /usr/lib/systemd/systemd-modules-load
5) # /usr/lib/systemd/systemd

As the valgrind logs are quite big, I'll add them as attachments rather than pasting them directly into this comment.

Comment 1 Frantisek Sumsal 2016-07-28 11:31:46 UTC
Created attachment 1185042 [details]
# systemctl disable postfix

Comment 2 Frantisek Sumsal 2016-07-28 11:32:05 UTC
Created attachment 1185043 [details]
# systemctl enable postfix

Comment 3 Frantisek Sumsal 2016-07-28 11:32:22 UTC
Created attachment 1185044 [details]
# journalctl --no-pager -u system.slice

Comment 4 Frantisek Sumsal 2016-07-28 11:32:43 UTC
Created attachment 1185045 [details]
/usr/lib/systemd/systemd-modules-load

Comment 5 Frantisek Sumsal 2016-07-28 11:33:03 UTC
Created attachment 1185046 [details]
/usr/lib/systemd/systemd

Comment 7 Frantisek Sumsal 2016-08-22 07:18:57 UTC
On Friday I found out that systemd-nspawnd -D behaves differently than systemd-nspawnd -bD - even though I had the recompiled version installed literally everywhere, it still somehow showed leaks which it shouldn't show. After rewriting our test case to use systemd-nspawnd -bD with systemd-run -M I was able to (hopefully) get relevant results for the most recent systemd version.

I'll upload the new valgrind logs shortly.

Comment 8 Frantisek Sumsal 2016-08-22 07:19:31 UTC
Comment on attachment 1185042 [details]
# systemctl disable postfix

No leaks found in the new version.

Comment 9 Frantisek Sumsal 2016-08-22 07:19:54 UTC
Comment on attachment 1185043 [details]
# systemctl enable postfix

No leaks found in the new version.

Comment 10 Frantisek Sumsal 2016-08-22 07:21:57 UTC
Created attachment 1192781 [details]
# journalctl --no-pager -u system.slice

Comment 11 Frantisek Sumsal 2016-08-22 07:22:54 UTC
Created attachment 1192782 [details]
/usr/lib/systemd/systemd-modules-load

Comment 12 Frantisek Sumsal 2016-08-22 07:24:00 UTC
Created attachment 1192783 [details]
/usr/lib/systemd/systemd

Comment 15 Frantisek Sumsal 2017-08-22 08:33:27 UTC
After several meetings with Michal, we managed to fix the test case by adding suppression rules for false-positives and other measures for accurate results reporting. Now valgrind reports no memory leaks for all mentioned scenarios in this thread. I would say it is safe to close this issue as it works in current release.