Bug 76782 - now(clockid_t clock_id) at src/shared/time-util.c fails
Summary: now(clockid_t clock_id) at src/shared/time-util.c fails
Status: RESOLVED NOTABUG
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-29 19:51 UTC by Dāvis
Modified: 2014-04-10 16:43 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Dāvis 2014-03-29 19:51:45 UTC
I upgraded systemd to latest 212-1 for Arch Linux which is inside OpenVZ container and systemd doesn't start anymore.

It fails with error
`Assertion 'clock_gettime(clock_id, &ts) == 0' failed at src/shared/time-util.c:32, function now(). Aborting.`


strace output

```
clock_gettime(CLOCK_MONOTONIC, {3262, 615930730}) = 0
clock_gettime(CLOCK_MONOTONIC, {3262, 615951010}) = 0
open("/proc/sys/kernel/random/boot_id", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 15
read(15, "08d9a51a-64ac-4ee7-bd6d-237c493e"..., 36) = 36
close(15)                               = 0
timerfd_settime(10, TFD_TIMER_ABSTIME, {it_interval={0, 0}, it_value={3352, 679749000}}, NULL) = 0
epoll_wait(3, {{EPOLLIN, {u32=26823648, u64=26823648}}}, 7, 0) = 1
clock_gettime(CLOCK_MONOTONIC, {3262, 616078247}) = 0
clock_gettime(0x7 /* CLOCK_??? */, 0x7fff79f0e550) = -1 EINVAL (Invalid argument)
writev(2, [{"\33[1;31m", 7}, {"Assertion 'clock_gettime(clock_i"..., 108}, {"\33[0m", 4}, {"\n", 1}], 4Assertion 'clock_gettime(clock_id, &ts) == 0' failed at src/shared/time-util.c:32, function now(). Aborting.
) = 120
```

using OpenVZ kernel 2.6.32-042stab078.27
Comment 1 Lennart Poettering 2014-04-10 01:39:41 UTC
This is probably CLOCK_BOOTTIME missing from the kernel. Note that kernels < 3.0 are not supported anyway, this is documented in the README.
Comment 2 Dāvis 2014-04-10 16:43:22 UTC
I've reported it to OpenVZ, they make backports so it doesn't matter if kernel is 2.6.32. Current solution is to use systemd-211 which works fine.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.