'sudo hwclock -s' fails with 'settimeofday() failed: Invalid argument'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
util-linux (Debian) |
Fix Released
|
Unknown
|
|||
util-linux (Ubuntu) |
Fix Released
|
High
|
Mauricio Faria de Oliveira |
Bug Description
In Focal VM.
util-linux: 2.34-0.1ubuntu8
$ sudo hwclock -s
[sudo] password for focal:
hwclock: settimeofday() failed: Invalid argument
Result should be syncing the time to the RTC, which until recently (possibly before glibc update) worked.
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: util-linux 2.34-0.1ubuntu8
ProcVersionSign
Uname: Linux 5.4.0-18-generic x86_64
ApportVersion: 2.20.11-0ubuntu22
Architecture: amd64
CurrentDesktop: KDE
Date: Thu Apr 2 11:20:45 2020
InstallationDate: Installed on 2019-12-24 (99 days ago)
InstallationMedia: Kubuntu 20.04 LTS "Focal Fossa" - Alpha amd64 (20191224)
SourcePackage: util-linux
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in util-linux (Debian): | |
status: | Unknown → New |
tags: | added: patch |
Changed in util-linux (Debian): | |
status: | New → Confirmed |
Changed in util-linux (Debian): | |
status: | Confirmed → Fix Released |
tags: | removed: sts-sponsor-mfo |
Rik, thanks for reporting this bug.
You're right, it's a regression in hwclock between glibc 2.30/2.31.
It's fixed in util-linux upstream; preparing a debdiff for Focal.
...
$ lsb_release -cs
focal
Older glibc:
---
$ dpkg -s util-linux libc6 | grep ^Version:
Version: 2.34-0.1ubuntu8
Version: 2.30-0ubuntu3
$ sudo hwclock -s
$ echo $?
0
Newer glibc:
---
$ sudo apt install libc6
.
The following packages will be upgraded:
libc-bin libc-dev-bin libc6 libc6-dev locales
.
$ dpkg -s util-linux libc6 | grep ^Version:
Version: 2.34-0.1ubuntu8
Version: 2.31-0ubuntu6
$ sudo hwclock -s
hwclock: settimeofday() failed: Invalid argument
$ echo $?
1
Upstream:
---
This is fixed with this upstream commit.
Preparing a debdiff for Focal.
ubuntu@ focal:~ /util-linux$ sudo ./hwclock -s
$ echo $?
0
commit cd781c405be8254 0484da3bfe3d3f1 7a39b8eb5c
Author: J William Piggott <email address hidden>
Date: Fri Feb 21 20:03:47 2020 -0500
hwclock: make glibc 2.31 compatible