Hello,

On 2019-04-15 5:10 p.m., O. Emmerson wrote:
For me it gives:

$ ./inv-year
time() = 1555369320
localtime() = 2019-04-16 00:02:00
                               (mday=16 wday=2, isdst=1)
struct tm (after adjustment) = 0009-04-16 00:02:00
                               (mday=16 wday=2, isdst=1)
inv-year: mktime() failed: Value too large for defined data type
>

On 2019-04-15 6:50 p.m., C de-Avillez wrote:
[...]
root@u1904:~# gcc -o inv-year inv-year.c
root@u1904:~# ./inv-year
time() = 1555375408
localtime() = 2019-04-16 00:43:28
               (mday=16 wday=2, isdst=0)
struct tm (after adjustment) = 0009-04-16 00:43:28
                                (mday=16 wday=2, isdst=0)
mktime() after date adjustment = -61874061392

So: a pristine 19.04 runs it. My laptop (which is my work machine,
full of other packages & programs), does not.


Thank you both for testing.

So, to summarize:
whenever "inv-year" fails - it is a problem with glibc on your
setup, *not* a problem in coreutils' date(1) program.

If there is a setup where "inv-year" succeeds but date(1) still fails,
then it is a problem in coreutils.

I'm glad to hear latest Ubuntu 19.04 is working fine
(though the reason for the earlier failure is still a mystery).

As Paul suggested, trying 'strace' on the failing system
might reveal more details.

regards,
 - assaf




Reply via email to