Bug 831132 - systemd journal leaks all logs into memory
Summary: systemd journal leaks all logs into memory
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 17
Hardware: All
OS: All
unspecified
high
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-12 09:33 UTC by Artur Zaprzała
Modified: 2012-06-20 19:25 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-06-20 19:25:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.