Bug 831132

Summary: systemd journal leaks all logs into memory
Product: [Fedora] Fedora Reporter: Artur Zaprzała <artur.zaprzala>
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 17CC: johannbg, lnykryn, metherid, mschmidt, msekleta, notting, plautrba, systemd-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 19:25:12 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:
Embargoed:

Description Artur Zaprzała 2012-06-12 09:33:21 UTC
Description of problem:
systemd-journald does not munmap log files after rotation. By default this log files are stored in /run/log/journal, which is a tmpfs filesystem, so old log files, though deleted, still occupy memory.

Fortunately it crashed before eating all memory:
Jun 11 16:46:26 myhost kernel: [150734.343131] systemd-journal[310]: segfault at 8 ip 00000000004061c2 sp 00007fff655d45a0 error 4 in systemd-journald[400000+1f000]
Jun 11 16:46:27 myhost systemd[1]: systemd-journald.service: main process exited, code=killed, status=11


Version-Release number of selected component (if applicable):
systemd-44-12.fc17.x86_64


How reproducible:
Always.


Steps to Reproduce:
Run a service that generates lots of syslog. Wait until journal logs are rotated.

  
Actual results:
/run file system and memory is filling up indefinitely. systemd-journald has all rotated log files mapped into memory:
lsof -c systemd-journal | grep /run/log/journal


Expected results:
By default systemd-journald should use no more than 10% of /run filesystem.
Only /run/log/journal/*/system.journal should be mapped into memory.

Comment 1 Artur Zaprzała 2012-06-12 09:52:07 UTC
systemd-journald crashed when no space left on /run filesystem.

Comment 2 Michal Schmidt 2012-06-12 11:09:33 UTC
I can reproduce the leaks in Rawhide.

Comment 3 Michal Schmidt 2012-06-12 11:15:49 UTC
I think it's f->header that's leaked.

Comment 5 Fedora Update System 2012-06-13 00:15:07 UTC
systemd-44-13.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/systemd-44-13.fc17

Comment 6 Artur Zaprzała 2012-06-13 11:53:15 UTC
There are no leaks with systemd-44-13. Thanks.

Comment 7 Fedora Update System 2012-06-15 12:28:01 UTC
Package systemd-44-14.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-44-14.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-9471/systemd-44-14.fc17
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2012-06-20 19:25:12 UTC
systemd-44-14.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.