<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - journalctl misbehaves when wall clock is changed"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=80858">80858</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>journalctl misbehaves when wall clock is changed
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>marius.vollmer@redhat.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=102202" name="attach_102202" title="test program.">attachment 102202</a> <a href="attachment.cgi?id=102202&action=edit" title="test program.">[details]</a></span>
test program.

With a specific set of journal files, we are seeing some odd behavior.  The
journal files cover multiple boots and have walltime discontinuities in them.

I'll send the journal files on request.

$ journalctl -D XXX/var/log/journal/ --cursor
's=de164a5e12e64f03b334128e4542ec9a;i=edb36;b=88b9ffdd4d2c40c1836f4a4d11c7d2bc;m=145f5aa0ae;t=4fc1b3c1b82f7;x=cf69db9bc053ff06'
-u NetworkManager --show-cursor | tail -1
-- cursor:
s=a6243fe62e0d45939c17eb9cb76f8812;i=11c34e;b=3e5244c588534eb4b4f3645d56b011c1;m=260accecf9;t=4fd38316fe7ed;x=38925d7bd704ad1d
$ journalctl -D XXX/var/log/journal/ --cursor
's=a6243fe62e0d45939c17eb9cb76f8812;i=11c34e;b=3e5244c588534eb4b4f3645d56b011c1;m=260accecf9;t=4fd38316fe7ed;x=38925d7bd704ad1d'
-u NetworkManager --show-cursor | tail -1
-- cursor:
s=de164a5e12e64f03b334128e4542ec9a;i=edb36;b=88b9ffdd4d2c40c1836f4a4d11c7d2bc;m=145f5aa0ae;t=4fc1b3c1b82f7;x=cf69db9bc053ff06

Thus, there are two cursors, and starting from one ends up at the other.

Also, doing sd_journal_seek_tail(), sd_journal_skip_previous(10) and then
looping over sd_journal_next until it returns 0 will happily loop over
thousands of entries, instead of the expected 10.

I attach a small program that combines these effects to get into an endless
loop, although it works correctly for most journal files.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>