journal: Skip data objects with invalid offsets v248.10
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 12 Jan 2022 14:44:50 +0000 (14:44 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 13 Jan 2022 10:27:45 +0000 (11:27 +0100)
commitdd32eb28a01441339ff88ec25905f40bd01d258d
treefe8232088ffd7dddf1f58f4be558f6ba2056744e
parent81903f092946df6559c9b68ac187eacb613b5901
journal: Skip data objects with invalid offsets

We already skip invalid objects, but don't yet skip invalid offsets.
Let's skip these as well to improve robustness when we're dealing with
corrupted journals.

Before:

```
➜  systemd git:(main) build/journalctl -r -n 5 --file ~/Downloads/system@0005d2b275abaaf8-f243a2818cb39b98.journal_
Failed to get journal fields: Cannot assign requested address
-- No entries --
```

After:

```
➜  systemd git:(main) ✗ build/journalctl -r -n 5 --file ~/Downloads/system@0005d2b275abaaf8-f243a2818cb39b98.journal_
Dec 09 08:32:38 snowball3 NetworkManager[911]: <info>  [1639038758.1464] device (wlp1s0): supplicant interface state: scanning -> authenticating
Dec 09 08:32:38 snowball3 kernel: wlp1s0: send auth to ec:a9:40:79:fb:ad (try 1/3)
Dec 09 08:32:38 snowball3 kernel: wlp1s0: authenticate with ec:a9:40:79:fb:ad
Dec 09 08:32:38 snowball3 wpa_supplicant[1003]: wlp1s0: SME: Trying to authenticate with ec:a9:40:79:fb:ad (SSID='UPC949397B' freq=5500 MHz)
```

(cherry picked from commit df207ccb7be02b1ca6bdd0a2066a898e5b24ee86)
(cherry picked from commit 556f46aa3b17f4ed6768521137405297c8a99d35)
(cherry picked from commit bf022f9f4841368bb84372ee5605ce5c0f936c79)
src/libsystemd/sd-journal/sd-journal.c