Bug 964008

Summary: Segmention fault in journalctl
Product: [Fedora] Fedora Reporter: David Strauss <david>
Component: systemdAssignee: Michal Schmidt <mschmidt>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: johannbg, lnykryn, mschmidt, msekleta, notting, plautrba, systemd-maint, vpavlin, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-01 18:38:06 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 David Strauss 2013-05-17 03:18:43 UTC
This code may be completely different in current journalctl implementations, but here's what I found. Presumably, f->path could be NULL at the time this log item tries to print.

[straussd@endpoint21d5d347 tmp]$ sudo gdb -ex "set pagination 0" -ex "thread apply all bt" -batch `which journalctl` coredump.journalctl.18997.endpoint21d5d347.1367282164
[New LWP 18997]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `journalctl -o json -f'.
Program terminated with signal 11, Segmentation fault.
#0  remove_file (j=j@entry=0x25d4010, prefix=prefix@entry=0x25e3130 "/run/log/journal/05046d45ef454d85af397025b312cff6", filename=filename@entry=0x7fff0f05db20 "system", dir=0x0) at src/journal/sd-journal.c:1018
1018	        log_debug("File %s got removed.", f->path);

Thread 1 (Thread 0x7f6eaa97c780 (LWP 18997)):
#0  remove_file (j=j@entry=0x25d4010, prefix=prefix@entry=0x25e3130 "/run/log/journal/05046d45ef454d85af397025b312cff6", filename=filename@entry=0x7fff0f05db20 "system", dir=0x0) at src/journal/sd-journal.c:1018
#1  0x0000003e0d60564b in process_inotify_event (e=<optimized out>, j=<optimized out>) at src/journal/sd-journal.c:1565
#2  sd_journal_process (j=0x25d4010) at src/journal/sd-journal.c:1644
#3  0x000000000040292e in main (argc=<optimized out>, argv=<optimized out>) at src/journal/journalctl.c:368

Comment 1 David Strauss 2013-05-17 03:20:16 UTC
Here's the version that box has installed.

Installed Packages
Name        : systemd
Arch        : x86_64
Version     : 44
Release     : 24.fc17

Comment 2 David Strauss 2013-05-17 03:21:32 UTC
Correction: Presumably, f could be NULL at the time this log item tries to print. The printf-like functionality behind log_debug will work around f->path being NULL if f isn't.

Comment 3 Michal Schmidt 2013-05-17 08:44:07 UTC
We cannot access f->path after journal_file_close(f). This got fixed upstream in:

commit 44a5fa34d9f9a5050cdf4a497e6ccf5af2d1678d
Author: Lennart Poettering <lennart>
Date:   Tue Oct 16 22:59:28 2012 +0200

    sd-journal: fix bad memory access

Comment 4 Fedora End Of Life 2013-07-04 06:57:21 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2013-08-01 18:38:11 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.