Wind River Support Network

HomeDefectsLINCD-1080
Fixed

LINCD-1080 : intel-x86-64: The 'hwclock -s' report hwclock: settimeofday() failed: Invalid argument

Created: Feb 14, 2020    Updated: Mar 19, 2020
Resolved Date: Feb 26, 2020
Found In Version: 10.20.9.0
Fix Version: 10.20.12.0
Severity: Standard
Applicable for: Wind River Linux CD
Component/s: BSP

Description

root@intel-x86-64:~# hwclock --set --date="2014-12-18 05:12:00" root@intel-x86-64:~# hwclock -s hwclock: settimeofday() failed: Invalid argument root@intel-x86-64:~# hwclock -h Usage: hwclock [function] [option...] Time clocks utility. Functions: -r, --show display the RTC time --get display drift corrected RTC time --set set the RTC according to --date -s, --hctosys set the system time from the RTC -w, --systohc set the RTC from the system time --systz send timescale configurations to the kernel -a, --adjust adjust the RTC to account for systematic drift --predict predict the drifted RTC time according to --date Options: -u, --utc the RTC timescale is UTC -l, --localtime the RTC timescale is Local -f, --rtc <file> use an alternate file to /dev/rtc0 --directisa use the ISA bus instead of /dev/rtc0 access --date <time> date/time input for --set and --predict --delay <sec> delay used when set new RTC time --update-drift update the RTC drift factor --noadjfile do not use /etc/adjtime --adjfile <file> use an alternate file to /etc/adjtime --test dry run; implies --verbose -v, --verbose display more details -h, --help display this help -V, --version display version For more details see hwclock(8). root@intel-x86-64:~# hwclock -r 2014-12-18 05:13:08.056711+00:00 root@intel-x86-64:~# root@intel-x86-64:~# date Fri Feb 14 07:44:38 UTC 2020 root@intel-x86-64:~# root@intel-x86-64:~# hwclock -s hwclock: settimeofday() failed: Invalid argument root@intel-x86-64:~# strace hwclock -s execve("/sbin/hwclock", ["hwclock", "-s"], 0x7ffdb9786a08 /* 19 vars */) = 0 brk(NULL) = 0x558f55559000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat(3, \{st_mode=S_IFREG|0644, st_size=26064, ...}) = 0 mmap(NULL, 26064, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fcd7e441000 close(3) = 0 openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0n\2W:\0\0\0"..., 832) = 832 fstat(3, \{st_mode=S_IFREG|0755, st_size=1811568, ...}) = 0 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcd7e43f000 mmap(NULL, 1819448, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fcd7e282000 mprotect(0x7fcd7e2a7000, 1630208, PROT_NONE) = 0 mmap(0x7fcd7e2a7000, 1318912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7fcd7e2a7000 mmap(0x7fcd7e3e9000, 307200, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x167000) = 0x7fcd7e3e9000 mmap(0x7fcd7e435000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b2000) = 0x7fcd7e435000 mmap(0x7fcd7e43b000, 13112, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fcd7e43b000 close(3) = 0 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcd7e280000 arch_prctl(ARCH_SET_FS, 0x7fcd7e440600) = 0 mprotect(0x7fcd7e435000, 12288, PROT_READ) = 0 mprotect(0x558f55556000, 8192, PROT_READ) = 0 mprotect(0x7fcd7e471000, 4096, PROT_READ) = 0 munmap(0x7fcd7e441000, 26064) = 0 brk(NULL) = 0x558f55559000 brk(0x558f5557a000) = 0x558f5557a000 openat(AT_FDCWD, "/dev/rtc0", O_RDONLY) = 3 access("/etc/adjtime", R_OK) = 0 openat(AT_FDCWD, "/etc/adjtime", O_RDONLY) = 4 fstat(4, \{st_mode=S_IFREG|0644, st_size=44, ...}) = 0 read(4, "0.000000 1418879520 0.000000\n141"..., 4096) = 44 close(4) = 0 ioctl(3, RTC_UIE_ON) = 0 select(4, [3], NULL, NULL, \{tv_sec=10, tv_usec=0}) = 1 (in [3], left \{tv_sec=9, tv_usec=343049}) ioctl(3, PHN_NOT_OH or RTC_UIE_OFF) = 0 ioctl(3, RTC_RD_TIME, \{tm_sec=27, tm_min=13, tm_hour=5, tm_mday=18, tm_mon=11, tm_year=114, ...}) = 0 openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = 4 fstat(4, \{st_mode=S_IFREG|0644, st_size=114, ...}) = 0 fstat(4, \{st_mode=S_IFREG|0644, st_size=114, ...}) = 0 read(4, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 114 lseek(4, -60, SEEK_CUR) = 54 read(4, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 60 close(4) = 0 write(2, "hwclock: ", 9hwclock: ) = 9 write(2, "settimeofday() failed", 21settimeofday() failed) = 21 write(2, ": Invalid argument\n", 19: Invalid argument ) = 19 close(3) = 0 close(1) = 0 close(2) = 0 exit_group(1) = ? +++ exited with 1 +++

Steps to Reproduce

See:
http://pek-lpgtest3.wrs.com/lpg-build/cdc/publiclog/WRLinuxCDNext/lxCD---S05/2020WW07/GIT_20200214/BSP/intel-x86-64_standard_glibc-cgl/NUC7i5DNK1E_OE_systemd/rtc_hctosys/target_28554.platform_B1E1R0_20200214_121445.log
or
/opt/wr-test/main_test.py -k rtc_hctosys: -q
Live chat
Online