mirleft / ocaml-asn1-combinators

Embed typed ASN.1 grammars in OCaml
ISC License
35 stars 20 forks source link

Test failure on i686 #13

Closed vbgl closed 7 years ago

vbgl commented 9 years ago

The test suite fails on i686 (i.e., 32 bits architecture), see log.

The error comes from random_time_tests, with t = 2780622788. and t' = -2147483648. and originates from the behaviour of Unix.gmtime which returns {Unix.tm_sec = 8; tm_min = 13; tm_hour = 3; tm_mday = 11; tm_mon = 1; tm_year = 158; tm_wday = 1; tm_yday = 41; tm_isdst = false} on x86_64 and {Unix.tm_sec = 52; tm_min = 45; tm_hour = 20; tm_mday = 13; tm_mon = 11; tm_year = 1; tm_wday = 5; tm_yday = 346; tm_isdst = false} on i686.

This may relate to the Year 2038 bug and be an issue with the test suite (rather than with the code being tested): Unix.gmtime should not be called with random overflowing values.

dbuenzli commented 9 years ago

Yes that's a correct analysis. On 32-bit platforms the random integers should be clipped to the interval [-2^32;2^32-1]

domenkozar commented 9 years ago

@mirleft any chance to fix this?