Bug #477
test_asn1 failures on 32-bit hardware
Start date:
02.01.2014
Due date:
Estimated time:
Affected version:
dr|rc|master
Resolution:
Fixed
Description
I uploaded the 5.1.2~dr2 tarball to Ubuntu and the unit tests fail on i386 and powerpc.
On i386, the build reports the following:
... gcc -DHAVE_CONFIG_H -I. -I../../.. -D_FORTIFY_SOURCE=2 -I../../../src/libstrongswan -I../../../src/libstrongswan/tests -DPLUGINDIR=\""../../../src/libstrongswan/plugins\"" -DPLUGINS=\""test-vectors curl soup unbound ldap mysql sqlite pkcs11 aes rc2 sha1 sha2 md4 md5 rdrand random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem padlock openssl gcrypt af-alg fips-prf gmp agent xcbc cmac hmac ctr ccm gcm ntru\"" -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -include /build/buildd/strongswan-5.1.2~dr2/config.h -c -o suites/tests-test_test_rng.o `test -f 'suites/test_test_rng.c' || echo './'`suites/test_test_rng.c suites/test_asn1.c: In function 'test_asn1_to_time': suites/test_asn1.c:475:3: warning: this decimal constant is unsigned only in ISO C90 [enabled by default] { 4107542400, 0x18, "210003010000Z" } ^ suites/test_asn1.c: In function 'test_asn1_from_time': suites/test_asn1.c:515:9: warning: this decimal constant is unsigned only in ISO C90 [enabled by default] { 4107542400, 0x18, chunk_from_chars( ^ ...
And then proceeds to fail with:
... Running suite 'asn1': Running case 'algorithmIdentifier': + Running case 'parse_algorithmIdentifier': + Running case 'known_oid': + Running case 'build_known_oid': + Running case 'oid_from_string': + Running case 'oid_to_string': + Running case 'length': + Running case 'unwrap': + Running case 'is_asn1': + Running case 'is_printablestring': + Running case 'to_time': - Failure in 'test_asn1_to_time': asn1_to_time(&chunk, test[i].type) == test[i].time (suites/test_asn1.c:488, i = 0) Running case 'from_time': - Failure in 'test_asn1_from_time': chunk_equals(chunk, test[i].chunk) (suites/test_asn1.c:530, i = 0) ...
Full log may be found here: https://launchpadlibrarian.net/161457887/buildlog_ubuntu-trusty-i386.strongswan_5.1.2~dr2-0ubuntu1_FAILEDTOBUILD.txt.gz
Associated revisions
History
#1 Updated by Jonathan Davies about 7 years ago
The test in question tries to check if the 'time' member is greater than the maximum value of a time_t isn't ever going to happen, since it is itself a time_t.
I've worked around this for now in the packages by checking "< 0" instead and have a Git branch here:
#2 Updated by Tobias Brunner about 7 years ago
- Tracker changed from Issue to Bug
- Category set to testing
- Status changed from New to Resolved
- Assignee set to Tobias Brunner
- Target version set to 5.1.2
- Resolution set to Fixed
Thanks, I pushed a slightly different fix to the repository (also fixes the compiler warnings).
#3 Updated by Tobias Brunner almost 7 years ago
- Status changed from Resolved to Closed
test-asn1: Fix skipping of >2038 tests on i386
The two constants overflow time_t on i386 (they also produced a compiler
warning without type suffix) so the comparison with TIME_32_BIT_SIGNED_MAX
did not work as intended.
Fixes #477.