Open frans42 opened 7 months ago
Seems to affect jq on RHEL distros over a larger range of major versions:
> jq 'fromdateiso8601 - (fromdateiso8601|todateiso8601|fromdateiso8601)' <<<'"2024-04-04T20:00:18Z"'
-3600
> cat /etc/redhat-release
CentOS Stream release 8
> jq --version
jq-1.6
I forgot to mention this: the problem occurs only with date stamps in local summer time:
> jq 'fromdateiso8601 - (fromdateiso8601|todateiso8601|fromdateiso8601)' <<<'"2024-04-04T20:00:18Z"'
-3600
> jq 'fromdateiso8601 - (fromdateiso8601|todateiso8601|fromdateiso8601)' <<<'"2024-02-04T20:00:18Z"'
0
> date
Mon Apr 29 09:26:20 CEST 2024
> timedatectl
Local time: Mon 2024-04-29 09:27:05 CEST
Universal time: Mon 2024-04-29 07:27:05 UTC
RTC time: Mon 2024-04-29 07:27:06
Time zone: Europe/Copenhagen (CEST, +0200)
NTP enabled: no
NTP synchronized: yes
RTC in local TZ: no
DST active: yes
Last DST change: DST began at
Sun 2024-03-31 01:59:59 CET
Sun 2024-03-31 03:00:00 CEST
Next DST change: DST ends (the clock jumps one hour backwards) at
Sun 2024-10-27 02:59:59 CEST
Sun 2024-10-27 02:00:00 CET
Thanks, that is good to know. I tried to reproduce with centos:7 docker image (with macOS as host) but i'm failing to setup a locale with CEST. I don't know much about redhat/centos so i'm a bit lost. Could you try and possibly give some reproduction steps like a Dockerfile? that would help a lot. Also i noticed that jq i managed to install via yum is jq 1.5. Are you using https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64?
For sanity could you also try with jq 1.7.1 and jq master?
So far I'm using the distro versions. I'm not sure if it is possible to reproduce this within a container, the time management is likely inside the kernel and you might need a full KVM for reproduction. I will give it a go a soon as I have time, hopefully within the next 2 weeks. I will also try to compare the distro version with a build from source.
That would be great. Think it will be hard and time consuming to debug this for someone without reproduction steps
I believe this is a duplicate of #2001 and can probably be closed, since it is fixed in jq 1.7 (though that version still isn't released to Debian and probably other systems as well).
Reading through the related reports it looks very much like its a duplicate. Even the workaround is the same. I hope 1.7 will be packaged soon. Good that it was already addressed, didn't have much time to investigate this so far but it was still on my list.
I observe weird behaviour with the same version of jq on different distros:
On CentOS 7:
Same test on Ubuntu 20.04:
It seems to be linked against the same libraries:
Centos 7:
Ubuntu 20.04:
Could be an issue with a distro library version. Any idea where the problem might be?