RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1446140 - sd_journal_process() reports invalidation of journal files even when no invalidating event (unlink, rotation) took place
Summary: sd_journal_process() reports invalidation of journal files even when no inval...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.3
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks: 1419228
TreeView+ depends on / blocked
 
Reported: 2017-04-27 10:20 UTC by Michal Sekletar
Modified: 2017-08-01 09:14 UTC (History)
2 users (show)

Fixed In Version: systemd-219-39.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 09:14:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2297 0 normal SHIPPED_LIVE systemd bug fix and enhancement update 2017-08-01 12:40:16 UTC

Description Michal Sekletar 2017-04-27 10:20:53 UTC
Description of problem:
$subject

Version-Release number of selected component (if applicable):
systemd-219-30.el7_3.8

How reproducible:
deterministic

Steps to Reproduce:
1. Compile following C program
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include <systemd/sd-journal.h>

/* gcc journal-process-test.c -l systemd */

int main(void) {
        int r;
        sd_journal *j;

        r = sd_journal_open(&j, SD_JOURNAL_CURRENT_USER|SD_JOURNAL_LOCAL_ONLY);
        if (r < 0) {
                fprintf(stderr, "Failed to open system journal: %m");
                return EXIT_FAILURE;
        }

	/* seek to last message in journal */
        sd_journal_get_fd(j);
        sd_journal_seek_tail(j);
        sd_journal_previous(j);

	/* write to syslog and wait a bit for journal to append the message */
	openlog("sd-journal-process-test", LOG_NDELAY|LOG_PID, LOG_USER);
	syslog(LOG_DAEMON|LOG_ERR, "test message");

	sleep(1);
	
        r = sd_journal_process(j);
        switch (r) {
        case SD_JOURNAL_NOP:
                puts("nop");
                break;
        case SD_JOURNAL_APPEND:
                puts("append");
                break;
        case SD_JOURNAL_INVALIDATE:
                puts("invalidate");
                break;
        default:
                fprintf(stderr, "Failed to process journal events: %m");
                return EXIT_FAILURE;
        }

        return 0;
}   
2. Login as root user
3. Run ./a.out

Actual results:
Program output is "invalidate"


Expected results:
Program should be "append"

Additional info:
Note that on otherwise idle system it is very unlikely for actual journal invalidation to take place right after we append to journal via syslog(). Hence in 99.99999999% of cases program should really print "append" once the bug is fixed. Ideally we would detect possible invalidation and retry the test case instead of producing false-negative, but possibility of that happening so low that I don't bother.

Upstream fix,

https://github.com/systemd/systemd/pull/5580

Comment 3 Lukáš Nykrýn 2017-05-02 09:46:55 UTC
fix merged to upstream staging branch ->
https://github.com/lnykryn/systemd-rhel/commit/ca55fb67bc81313edf0aa6523b6f9ffce50ecdda
-> post

Comment 6 errata-xmlrpc 2017-08-01 09:14:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2297


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