SBECK-github / Date-Manip

Other
10 stars 11 forks source link

armv7l/Raspberry Pi 3: $now + 1 day == December 2015 #22

Closed AlD closed 6 years ago

AlD commented 6 years ago

On a Raspberry Pi 3 using Archlinux ARM I'm getting a date 13 years back for 'now + 1 day':

$ perl -MDate::Manip -le '$now = ParseDate("now");
print $now;
print DateCalc($now, "+1 day");'
2018062522:11:23
2005121322:11:23

$ perl -MDate::Manip=9999
Date::Manip version 9999 required--this is only version 6.72 at /usr/share/perl5/core_perl/Exporter/Heavy.pm line 125.
BEGIN failed--compilation aborted.

$ perl -V
Summary of my perl5 (revision 5 version 26 subversion 2) configuration:

  Platform:
    osname=linux
    osvers=4.14.29-1-arch
    archname=armv7l-linux-thread-multi
    uname='linux leming 4.14.29-1-arch #1 smp preempt fri mar 23 02:57:06 utc 2018 armv7l gnulinux '
    config_args='-des -Dusethreads -Duseshrplib -Doptimize=-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector-strong -fno-plt -Dprefix=/usr -Dvendorprefix=/usr -Dprivlib=/usr/share/perl5/core_perl -Darchlib=/usr/lib/perl5/5.26/core_perl -Dsitelib=/usr/share/perl5/site_perl -Dsitearch=/usr/lib/perl5/5.26/site_perl -Dvendorlib=/usr/share/perl5/vendor_perl -Dvendorarch=/usr/lib/perl5/5.26/vendor_perl -Dscriptdir=/usr/bin/core_perl -Dsitescript=/usr/bin/site_perl -Dvendorscript=/usr/bin/vendor_perl -Dinc_version_list=none -Dman1ext=1perl -Dman3ext=3perl -Dlddlflags=-shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Dldflags=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=undef
    use64bitall=undef
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='cc'
    ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
    optimize='-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector-strong -fno-plt'
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='7.3.1 20180312'
    gccosandvers=''
    intsize=4
    longsize=4
    ptrsize=4
    doublesize=8
    byteorder=1234
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=8
    longdblkind=0
    ivtype='long'
    ivsize=4
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='cc'
    ldflags ='-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/gcc/armv7l-unknown-linux-gnueabihf/7.3.1/include-fixed /usr/lib /lib
    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.26.so
    so=so
    useshrplib=true
    libperl=libperl.so
    gnulibc_version='2.26'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/5.26/core_perl/CORE'
    cccdlflags='-fPIC'
    lddlflags='-shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -fstack-protector-strong'

Characteristics of this binary (from libperl):
  Compile-time options:
    HAS_TIMES
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
    PERL_IMPLICIT_CONTEXT
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    USE_ITHREADS
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
    USE_REENTRANT_API
  Built under linux
  Compiled at Apr 20 2018 22:02:24
  @INC:
    /usr/lib/perl5/5.26/site_perl
    /usr/share/perl5/site_perl
    /usr/lib/perl5/5.26/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib/perl5/5.26/core_perl
    /usr/share/perl5/core_perl
SBECK-github commented 6 years ago

Sorry for the slow response. I was on vacation for 2 weeks and then playing catch up with everything.

Unfortunately, I do not have a raspberry pi box to play with, so I have not been able to reproduce this. Would there be any possibility of creating a test account on it that I could log in to and debug? I'm assuming not... but if that is a possibility, let me know.

In the meantime, perhaps you could run the following:

##################### use Data::Dumper; use Date::Manip::Date; use Date::Manip::Delta;

$obj1 = new Date::Manip::Date; $obj1->parse('now'); print Dumper $$obj1{'data'};

$obj2 = new Date::Manip::Delta; $obj2->parse('+1 day'); print Dumper $$obj2{'data'};

$obj1->calc($obj2); print Dumper $$obj1{'data'}; ###############################

and give me the output.

Thanks

AlD commented 6 years ago

I just tested on a RPi 2 (armv6l) with raspbian, and the issue doesn't occur there.

This is the output from your snippet:

$VAR1 = {
          'def' => [
                     0,
                     0,
                     0,
                     0,
                     0,
                     0
                   ],
          'offset' => [
                        2,
                        0,
                        0
                      ],
          'gmt' => [],
          'zin' => '',
          'in' => 'now',
          'tz' => 'europe/berlin',
          'f' => {},
          'isdst' => 1,
          'date' => [
                      2018,
                      8,
                      7,
                      20,
                      43,
                      40
                    ],
          'loc' => [],
          'abb' => 'CEST',
          'set' => 1
        };
$VAR1 = {
          'mode' => 'standard',
          'in' => '+1 day',
          'flen' => {},
          'type_from' => 'det',
          'gotmode' => 1,
          'length' => 'unknown',
          'type' => 'semi',
          'normalized' => 1,
          'f' => {},
          'delta' => [
                       0,
                       0,
                       0,
                       1,
                       0,
                       0,
                       0
                     ]
        };
$VAR1 = {
          'def' => [
                     0,
                     0,
                     0,
                     0,
                     0,
                     0
                   ],
          'offset' => [
                        2,
                        0,
                        0
                      ],
          'gmt' => [],
          'zin' => '',
          'in' => 'now',
          'tz' => 'europe/berlin',
          'f' => {},
          'isdst' => 1,
          'date' => [
                      2018,
                      8,
                      7,
                      20,
                      43,
                      40
                    ],
          'loc' => [],
          'abb' => 'CEST',
          'set' => 1
        };
SBECK-github commented 6 years ago

This is now fixed and will be in the next release due out in a couple weeks.