Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 184484 - app-crypt/gnupg-2.0.6 gettime test failure
Summary: app-crypt/gnupg-2.0.6 gettime test failure
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Lowest minor (vote)
Assignee: Crypto team [DISABLED]
URL: https://bugs.g10code.com/gnupg/issue811
Whiteboard:
Keywords:
Depends on:
Blocks: 137705
  Show dependency tree
 
Reported: 2007-07-07 10:24 UTC by Rickard Närström
Modified: 2009-02-15 03:09 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
gnupg-2.0.5-test.patch (gnupg-2.0.5-test.patch,397 bytes, patch)
2007-07-07 16:07 UTC, Alon Bar-Lev (RETIRED)
Details | Diff
gnupg-2.0.5-gettime.patch (gnupg-2.0.5-gettime.patch,575 bytes, patch)
2007-07-07 16:52 UTC, Alon Bar-Lev (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rickard Närström 2007-07-07 10:24:50 UTC
----
make[1]: Entering directory `/var/tmp/paludis/app-crypt/gnupg-2.0.5/work/gnupg-2.0.5/common'
make  check-TESTS
make[2]: Entering directory `/var/tmp/paludis/app-crypt/gnupg-2.0.5/work/gnupg-2.0.5/common'
PASS: t-convert
t-gettime.c:68: test 2 failed
t-gettime.c:68: test 4 failed
t-gettime.c:68: test 5 failed
t-gettime.c:68: test 6 failed
t-gettime.c:68: test 7 failed
t-gettime.c:68: test 8 failed
t-gettime.c:68: test 9 failed
t-gettime.c:68: test 10 failed
t-gettime.c:68: test 11 failed
t-gettime.c:68: test 12 failed
t-gettime.c:68: test 13 failed
t-gettime.c:68: test 14 failed
t-gettime.c:68: test 15 failed
FAIL: t-gettime
====================================
1 of 2 tests failed
Please report to bug-gnupg@gnupg.org
====================================
make[2]: *** [check-TESTS] Error 1
make[2]: Leaving directory `/var/tmp/paludis/app-crypt/gnupg-2.0.5/work/gnupg-2.0.5/common'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/var/tmp/paludis/app-crypt/gnupg-2.0.5/work/gnupg-2.0.5/common'
make: *** [check-recursive] Error 1

!!! ERROR in app-crypt/gnupg-2.0.5:
!!! In src_test at line 29
!!! make check failed

!!! Call stack:
!!!    * src_test (/usr/libexec/paludis/src_test.bash:29)
!!!    * ebuild_f_test (/usr/libexec/paludis/src_test.bash:71)
!!!    * ebuild_main (/usr/libexec/paludis/ebuild.bash:363)
!!!    * main (/usr/libexec/paludis/ebuild.bash:381)


!!! This package failed inside the test phase. You should read
!!!    http://paludis.pioto.org/faq.html
!!! for more information on packages with test phase failures.


die trap: exiting with error.
----


Some of those testfailure are because I am using a TAI timezone, changing to a UTC timezone and some (but not all) of them will succeed.

----
# TZ=Europe/Stockholm ./t-gettime
t-gettime.c:68: test 4 failed
t-gettime.c:68: test 5 failed
t-gettime.c:68: test 6 failed
t-gettime.c:68: test 7 failed
t-gettime.c:68: test 8 failed
t-gettime.c:68: test 15 failed
----
Comment 1 Rickard Närström 2007-07-07 10:26:15 UTC
Sorry forgot...

----
paludis 0.24.2

Built by paludisbuild@workstation on 2007-05-14T15:27:02+0200
CXX:         x86_64-pc-linux-gnu-g++ 4.1.2 20070214 (  (gdc 0.23, using dmd 1.007)) (Gentoo 4.1.2)
CXXFLAGS:    -O3 -fomit-frame-pointer -march=k8 -pipe
LDFLAGS:
DATADIR:     /usr/share
LIBDIR:      /usr/lib64
LIBEXECDIR:  /usr/libexec
SYSCONFDIR:  /etc
stdlib:      GNU libstdc++ 20070214
libebt:      1.3.0
libwrapiter: 1.0.0
sandbox:     enabled

Repository virtuals:
    Configuration information:
        format:                virtuals

Repository installed_virtuals:
    Configuration information:
        format:                installed_virtuals

Repository gentoo:
    Configuration information:
        buildroot:             /var/tmp/paludis
        cache:                 /var/paludis/repositories/gentoo/metadata/cache
        distdir:               /var/paludis/distfiles
        eclassdirs:            /var/paludis/repositories/gentoo/eclass
        format:                ebuild
        location:              /var/paludis/repositories/gentoo
        names_cache:           /var/paludis/repositories/gentoo/.cache/names
        newsdir:               /var/paludis/repositories/gentoo/metadata/news
        pkgdir:                /var/paludis/repositories/gentoo/packages
        profiles:              /var/paludis/repositories/gentoo/profiles/default-linux/amd64/2007.0/desktop
        securitydir:           /var/paludis/repositories/gentoo/metadata/glsa
        setsdir:               /var/paludis/repositories/gentoo/sets
        sync:                  rsync://rsync.europe.gentoo.org/gentoo-portage/
        sync_options:
        write_cache:           /var/empty

    Package information:
        app-admin/eselect-compiler: (none)
        dev-java/java-config:  1.3.7, 2.0.33-r1
        dev-lang/python:       2.4.4-r4
        dev-python/pycrypto:   2.0.1-r5
        dev-util/ccache:       (none)
        dev-util/confcache:    (none)
        sys-apps/sandbox:      1.2.18.1
        sys-devel/autoconf:    2.13, 2.61-r1
        sys-devel/automake:    1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
        sys-devel/binutils:    2.17
        sys-devel/gcc-config:  1.3.16
        sys-devel/libtool:     1.5.24
        virtual/os-headers:    2.6.21

    Variable information:
        ACCEPT_KEYWORDS:
        AUTOCLEAN:
        CBUILD:                x86_64-pc-linux-gnu
        CFLAGS:                -Os -fomit-frame-pointer -march=k8 -pipe
        CHOST:                 x86_64-pc-linux-gnu
        CONFIG_PROTECT:
        CONFIG_PROTECT_MASK:
        CTARGET:
        CXXFLAGS:              -Os -fomit-frame-pointer -march=k8 -pipe
        DISTDIR:               /var/paludis/distfiles
        FEATURES:
        GENTOO_MIRRORS:
        INSTALL_MASK:
        LANG:
        LC_ALL:                C
        LDFLAGS:               -Wl,-O1 -Wl,--as-needed
        LINGUAS:
        MAKEOPTS:
        PKGDIR:
        PORTAGE_COMPRESS:
        PORTAGE_COMPRESS_FLAGS:
        PORTAGE_RSYNC_EXTRA_OPTS:
        PORTAGE_RSYNC_OPTS:
        PORTAGE_TMPDIR:        /var/tmp/paludis
        PORTDIR:               /var/paludis/repositories/gentoo
        PORTDIR_OVERLAY:
        SYNC:
        USE:

Repository installed:
    Configuration information:
        buildroot:             /var/tmp/paludis
        format:                vdb
        location:              /var/db/pkg
        names_cache:           /var/db/pkg/.cache/names
        provides_cache:        /var/db/pkg/.cache/provides
        root:                  /
        world:                 /var/db/pkg/world

Repository ricce_n-local:
    Configuration information:
        buildroot:             /var/tmp/paludis
        cache:                 /var/empty
        distdir:               /var/paludis/distfiles
        eclassdirs:            /var/paludis/repositories/gentoo/eclass /var/paludis/repositories/local/eclass
        format:                ebuild
        location:              /var/paludis/repositories/local
        master_repository:     gentoo
        names_cache:           /var/empty
        newsdir:               /var/paludis/repositories/local/metadata/news
        pkgdir:                /var/paludis/repositories/gentoo/packages
        profiles:              /var/paludis/repositories/gentoo/profiles/default-linux/amd64/2007.0/desktop
        securitydir:           /var/paludis/repositories/local/metadata/glsa
        setsdir:               /var/paludis/repositories/local/sets
        sync:
        sync_options:
        write_cache:           /var/empty
----
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2007-07-07 10:45:37 UTC
Is t-gettime is the only failing?
Comment 3 Rickard Närström 2007-07-07 11:22:32 UTC
Yes only t-gettime fails. I did run 'make -k check' and no test after t-gettime failed ether.
Comment 4 Alon Bar-Lev (RETIRED) gentoo-dev 2007-07-07 15:11:46 UTC
OK.
As far as I see, at:
common/gettime.c

There are two new functions:
isotime2epoch()
epoch2isotime()

The t-gettime is new for these...
If test4 is fails it is probably because util.h::atoi_4 macro is incorrect.
Can you please add:
printf ("year=%d\n", year);
Before:
/* Basic checks.  */
At:
common/gettime.c::isotime2epoch()
Comment 5 Rickard Närström 2007-07-07 15:40:09 UTC
Output is after adding the line:
----
year=1970
year=1970
year=1998
t-gettime.c:68: test 2 failed
year=1970
year=1969
t-gettime.c:68: test 4 failed
year=1900
t-gettime.c:68: test 5 failed
t-gettime.c:68: test 6 failed
t-gettime.c:68: test 7 failed
t-gettime.c:68: test 8 failed
year=2001
t-gettime.c:68: test 9 failed
year=2007
t-gettime.c:68: test 10 failed
year=2007
t-gettime.c:68: test 11 failed
year=2007
t-gettime.c:68: test 12 failed
year=2007
t-gettime.c:68: test 13 failed
year=2007
t-gettime.c:68: test 14 failed
t-gettime.c:68: test 15 failed
---
Comment 6 Alon Bar-Lev (RETIRED) gentoo-dev 2007-07-07 15:44:14 UTC
Thanks!
Strange...
Can you please run the test with --verbose?
Comment 7 Rickard Närström 2007-07-07 16:03:49 UTC
./t-gettime --verbose
year=1970
year=1970
year=1998
t-gettime.c:68: test 2 failed
string `19980815T143712' exp: 903191832 got: 903191853
year=1970
year=1969
t-gettime.c:68: test 4 failed
string `19691231T235959' exp: -1 got: 4294967295
year=1900
t-gettime.c:68: test 5 failed
string `19000101T000000' exp: -1 got: 4294967295
t-gettime.c:68: test 6 failed
string `' exp: -1 got: 4294967295
t-gettime.c:68: test 7 failed
string `19000101T00000' exp: -1 got: 4294967295
t-gettime.c:68: test 8 failed
string `20010101t123456' exp: -1 got: 4294967295
year=2001
t-gettime.c:68: test 9 failed
string `20010101T123456' exp: 978352496 got: 978352518
year=2007
t-gettime.c:68: test 10 failed
string `20070629T160000' exp: 1183132800 got: 1183132823
year=2007
t-gettime.c:68: test 11 failed
string `20070629T160000:' exp: 1183132800 got: 1183132823
year=2007
t-gettime.c:68: test 12 failed
string `20070629T160000,' exp: 1183132800 got: 1183132823
year=2007
t-gettime.c:68: test 13 failed
string `20070629T160000 ' exp: 1183132800 got: 1183132823
year=2007
t-gettime.c:68: test 14 failed
string `20070629T160000
' exp: 1183132800 got: 1183132823
t-gettime.c:68: test 15 failed
string `20070629T160000.' exp: -1 got: 4294967295
Comment 8 Alon Bar-Lev (RETIRED) gentoo-dev 2007-07-07 16:07:20 UTC
Created attachment 124150 [details, diff]
gnupg-2.0.5-test.patch

Found it!
Comment 9 Rickard Närström 2007-07-07 16:31:12 UTC
That patch solved test 4, 5, 6, 7, 8 and 15.

test 2, 9, 10, 11, 12, 13 and 14 still fails with a TAI timezone.
Comment 10 Alon Bar-Lev (RETIRED) gentoo-dev 2007-07-07 16:35:48 UTC
I cannot reproduce this:
TZ="Asia/Bangkok" ./t-gettime
Works...
Comment 11 Alon Bar-Lev (RETIRED) gentoo-dev 2007-07-07 16:52:53 UTC
Created attachment 124158 [details, diff]
gnupg-2.0.5-gettime.patch

Please try the following... It should ignore timezone and daylight.
Comment 12 Alon Bar-Lev (RETIRED) gentoo-dev 2007-07-07 17:36:04 UTC
So that we can keep track
Comment 13 Rickard Närström 2007-07-07 17:44:27 UTC
No that path didn't help. -- everything in the right folder is TAI timezones try "right/Asia/Bangkok" or "right/Europe/Stockholm" (my timezone) and it will fail.

see bug #137705 for more info on TAI vs. UTC
Comment 14 Alon Bar-Lev (RETIRED) gentoo-dev 2007-07-07 18:28:53 UTC
Correct me if I am wrong...
But the time calculated without the patch is correct, the expected test result is incorrect.
So the test should detect if the timezone is TAI and if so add the leap seconds to the expected results.

Do you know an API to determine if TAI is used? tzset() does not tell this, and gettimeofday() does not either.
Comment 15 Rickard Närström 2007-07-07 19:02:42 UTC
Take a look at http://bugs.gentoo.org/attachment.cgi?id=97631 -- it is meant to solve a similar problem in openntpd.

But it is probably a good idea to talk about this with upstream.
Comment 16 Alon Bar-Lev (RETIRED) gentoo-dev 2007-07-07 19:14:43 UTC
Opps...
Comment 17 Alon Bar-Lev (RETIRED) gentoo-dev 2007-12-13 18:54:32 UTC
See URL, upstream refuses to solve this... Blaming glibc...
Comment 18 Daniel Black (RETIRED) gentoo-dev 2009-02-15 03:09:18 UTC
patch has taken effect in upstream 2.0.9 and 2.0.10.