-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd-analyze critical-chain reports invalid timestamp #17191
Comments
hmm, this is weird... this system has an RTC? or is there a time jump at boot or so? |
It is a normal consumer-grade x86 laptop and has an RTC. I'm not sure about the time jump though, how can I check? |
Seeing the same line as well, systemd-250 (Arch).
System has an RTC, and I don't see a time discrepancy like I do when (re)booting my Raspberry Pi (which also has an added RTC module). |
same issue |
I can reproduce this quite easily locally with multiple units. For example, with a separate
The issue here is that the
So here:
we try to parse -732952 (2213745 - 2946697) as a timestamp, which is unsigned long, hence 18446744073708818664, and we get a garbage value:
Similarly, on my machine there's this one:
where, again,
and we get another garbage value. |
We have the following timestamp status: $ systemctl show systemd-fsck-root.service | grep InactiveExitTimestamp InactiveExitTimestamp=Thu 2023-11-02 12:27:24 CET InactiveExitTimestampMonotonic=15143158 $ systemctl show | grep UserspaceTimestamp UserspaceTimestamp=Thu 2023-11-02 12:27:25 CET UserspaceTimestampMonotonic=15804273 i.e. UserspaceTimestamp is before InactiveExit of systemd-fsck-root.service. This is fine, but on display, we'd subtract those values and print a huge negative value bogusly: $ build/systemd-analyze critical-chain systemd-remount-fs.service The time when unit became active or started is printed after the "@" character. The time the unit took to start is printed after the "+" character. systemd-remount-fs.service +137ms └─systemd-fsck-root.service @584542y 2w 2d 20h 1min 48.890s +45ms └─systemd-journald.socket └─system.slice └─-.slice In fact, list_dependencies_print() already had a branch where the check that 'times->activating > boot->userspace_time', but it didn't cover all cases. So make it cover both branches, and also change to '>=', since it's fine if something happened with the same timestamp. With the patch: $ build/systemd-analyze critical-chain systemd-remount-fs.service The time when unit became active or started is printed after the "@" character. The time the unit took to start is printed after the "+" character. systemd-remount-fs.service +42ms └─systemd-fsck-root.service └─systemd-journald.socket └─system.slice └─-.slice Fixes systemd#17191.
We have the following timestamp status: $ systemctl show systemd-fsck-root.service | grep InactiveExitTimestamp InactiveExitTimestamp=Thu 2023-11-02 12:27:24 CET InactiveExitTimestampMonotonic=15143158 $ systemctl show | grep UserspaceTimestamp UserspaceTimestamp=Thu 2023-11-02 12:27:25 CET UserspaceTimestampMonotonic=15804273 i.e. UserspaceTimestamp is before InactiveExit of systemd-fsck-root.service. This is fine, but on display, we'd subtract those values and print a huge negative value bogusly: $ build/systemd-analyze critical-chain systemd-remount-fs.service The time when unit became active or started is printed after the "@" character. The time the unit took to start is printed after the "+" character. systemd-remount-fs.service +137ms └─systemd-fsck-root.service @584542y 2w 2d 20h 1min 48.890s +45ms └─systemd-journald.socket └─system.slice └─-.slice In fact, list_dependencies_print() already had a branch where the check that 'times->activating > boot->userspace_time', but it didn't cover all cases. So make it cover both branches, and also change to '>=', since it's fine if something happened with the same timestamp. With the patch: $ build/systemd-analyze critical-chain systemd-remount-fs.service The time when unit became active or started is printed after the "@" character. The time the unit took to start is printed after the "+" character. systemd-remount-fs.service +42ms └─systemd-fsck-root.service └─systemd-journald.socket └─system.slice └─-.slice Fixes #17191.
systemd version the issue has been seen with
Used distribution
Expected behaviour you didn't see
Unexpected behaviour you saw
Notice that the
systemd-fsck-root.service
has a negative value as its timestamp, and that value gets parsed as an unsigned int64.I've tried to set a breakpoint in
list_dependencies_print
to inspect some values:Steps to reproduce the problem
Not sure, I haven't seen this before and don't believe it happens very often.
The text was updated successfully, but these errors were encountered: