Skip to contentSkip to conversation

uuidparse: test fails on 32bit machines

PATCH Ruediger Meier 3 participants 5 messages Jul 12, 2017 – Jul 18, 2017 Util-Linux package

lore
Share & tools
lore
#0 lore raw

Hi,

below you see the test diff when running on i586 or other 32bit archs. Could be that the program is fine and we could simply fix the test by not using such large timestamps, but maybe it's worth to review strtimeval_iso() and also libuuid/src/uuid_time.c for overflow handling.

home/rudi/devel/util-linux/build-32/tests/output/uuid/uuidparse 2017-07-12 18:48:04.874392934 +0000 renamed from home/rudi/devel/util-linux/tests/expected/uuid/uuidparse 2017-06-29 20:41:46.847789376 +0000 +2 -2
@@ -7,7 +7,7 @@
 00000000-0000-5000-0000-000000000000  NCS       sha1-based
 00000000-0000-6000-0000-000000000000  NCS       unknown
 00000000-0000-0000-8000-000000000000  DCE       nil
-00000000-0000-1000-8000-000000000000  DCE       time-based 60038-03-11 05:36:10,955161+0000
+00000000-0000-1000-8000-000000000000  DCE       time-based 1922-08-07 02:26:18,955161+0000
 00000000-0000-2000-8000-000000000000  DCE       DCE
 00000000-0000-3000-8000-000000000000  DCE       name-based
 00000000-0000-4000-8000-000000000000  DCE       random
@@ -28,6 +28,6 @@
 00000000-0000-5000-f000-000000000000  other     sha1-based
 00000000-0000-6000-f000-000000000000  other     unknown
 9b274c46-544a-11e7-a972-00037f500001  DCE       time-based 2017-06-18 17:21:46,544647+0000
-ffffffff-ffff-1fff-8fff-ffffffffffff  DCE       time-based 5236-03-31 21:21:00,684697+0000
+ffffffff-ffff-1fff-8fff-ffffffffffff  DCE       time-based 1969-10-19 10:02:36,684697+0000
 invalid-input                         invalid   invalid    invalid
 return value: 0

cu,
Rudi

maintainer
#1 lore raw
Quoted 21 lines · Ruediger Meier

Hi,

below you see the test diff when running on i586 or other 32bit archs. Could be that the program is fine and we could simply fix the test by not using such large timestamps, but maybe it's worth to review strtimeval_iso() and also libuuid/src/uuid_time.c for overflow handling.

home/rudi/devel/util-linux/build-32/tests/output/uuid/uuidparse 2017-07-12 18:48:04.874392934 +0000 renamed from home/rudi/devel/util-linux/tests/expected/uuid/uuidparse 2017-06-29 20:41:46.847789376 +0000 +1 -1
@@ -7,7 +7,7 @@
 00000000-0000-5000-0000-000000000000  NCS       sha1-based
 00000000-0000-6000-0000-000000000000  NCS       unknown
 00000000-0000-0000-8000-000000000000  DCE       nil
-00000000-0000-1000-8000-000000000000  DCE       time-based 60038-03-11 05:36:10,955161+0000
+00000000-0000-1000-8000-000000000000  DCE       time-based 1922-08-07 02:26:18,955161+0000
 00000000-0000-2000-8000-000000000000  DCE       DCE
 00000000-0000-3000-8000-000000000000  DCE       name-based
 00000000-0000-4000-8000-000000000000  DCE       random

home/rudi/devel/util-linux/build-32/tests/output/uuid/uuidparse 2017-07-12 18:48:04.874392934 +0000 line 33

Quoted 7 lines
home/rudi/devel/util-linux/build-32/tests/output/uuid/uuidparse 2017-07-12 18:48:04.874392934 +0000 renamed from home/rudi/devel/util-linux/tests/expected/uuid/uuidparse 2017-06-29 20:41:46.847789376 +0000 +1 -1
@@ -28,6 +28,6 @@
 00000000-0000-5000-f000-000000000000  other     sha1-based
 00000000-0000-6000-f000-000000000000  other     unknown
 9b274c46-544a-11e7-a972-00037f500001  DCE       time-based 2017-06-18 17:21:46,544647+0000
-ffffffff-ffff-1fff-8fff-ffffffffffff  DCE       time-based 5236-03-31 21:21:00,684697+0000
+ffffffff-ffff-1fff-8fff-ffffffffffff  DCE       time-based 1969-10-19 10:02:36,684697+0000
 invalid-input                         invalid   invalid    invalid
 return value: 0

I have removed this dates from the test. The things are internally based on time_t (=long) and uint32_t. It does not make sense to use it for huge numbers.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#2 lore raw
Quoted 3 lines · Karel Zak

I have removed this dates from the test. The things are internally based on time_t (=long) and uint32_t. It does not make sense to use it for huge numbers.

FYI I have created two travis testing branches in my private github
repo: https://travis-ci.org/rudimeier/util-linux/builds

travis-cc-test
- testing many different compilers versions, even using -Werror
- gcc 4.6, 4.8, 5, 6 and 7
- clang 3.4, 3.5, 3.9, 4.0 and 5.0
- OSX xcode 6.4, 7.3, 8.3

travis-cc-test
- testing 32bit build, -m32 -Werror

These build matrices are too big and ugly for our master branch, but probably I will keep them in my private repo to run them regularly/automated. So now, because of -Werror, we can stop wasting time, reviewing again and again our major travis logs for compiler warnings, etc.

Regarding -Werror, see the env column of the currently latest build here
https://travis-ci.org/rudimeier/util-linux/builds/254776766

I have added a few -Wno-error=xyz flags for gcc 4.x (false positives). And also one for gcc-7 which might be worth to fix.

Note, my both branches above include open pull request #486:
https://github.com/karelzak/util-linux/pull/486

cu,
Rudi

maintainer
#3 lore raw
Quoted 9 lines · Ruediger Meier
Quoted 3 lines · Karel Zak

I have removed this dates from the test. The things are internally based on time_t (=long) and uint32_t. It does not make sense to use it for huge numbers.

FYI I have created two travis testing branches in my private github
repo: https://travis-ci.org/rudimeier/util-linux/builds

Quoted 8 lines

travis-cc-test
- testing many different compilers versions, even using -Werror
- gcc 4.6, 4.8, 5, 6 and 7
- clang 3.4, 3.5, 3.9, 4.0 and 5.0
- OSX xcode 6.4, 7.3, 8.3

travis-cc-test
- testing 32bit build, -m32 -Werror

Would be possible to enable build by date? I would be nice to run basic builds tests for each commit and enable some additional expensive builds for example every 10 days (or/and trigger the build by git tags, e.g. -rcN).

Quoted 2 lines

Note, my both branches above include open pull request #486:
https://github.com/karelzak/util-linux/pull/486

Merged. Thanks.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#4 lore raw
Quoted 15 lines · Karel Zak
Quoted 14 lines · Ruediger Meier
Quoted 3 lines · Karel Zak

I have removed this dates from the test. The things are internally based on time_t (=long) and uint32_t. It does not make sense to use it for huge numbers.

FYI I have created two travis testing branches in my private github
repo: https://travis-ci.org/rudimeier/util-linux/builds

travis-cc-test
- testing many different compilers versions, even using
-Werror - gcc 4.6, 4.8, 5, 6 and 7
- clang 3.4, 3.5, 3.9, 4.0 and 5.0
- OSX xcode 6.4, 7.3, 8.3

Quoted 7 lines
Quoted 2 lines

travis-cc-test
- testing 32bit build, -m32 -Werror

Would be possible to enable build by date? I would be nice to run basic builds tests for each commit and enable some additional expensive builds for example every 10 days (or/and trigger the build by git tags, e.g. -rcN).

Yep, I will sort that out soon. Maybe creating another project "ul-test" which contains only test scripts. We could add even more checks there without polluting our main repo.

The tests should be invoked for interesting tags and once per week or something. To avoid unnecessary noise the extended tests should only run after at least our regular travis check finnished successfully.

cu,
Rudi