Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail in 2038 #20285

Closed
bmwiedemann opened this issue Aug 30, 2022 · 4 comments · Fixed by #20338
Closed

Tests fail in 2038 #20285

bmwiedemann opened this issue Aug 30, 2022 · 4 comments · Fixed by #20338

Comments

@bmwiedemann
Copy link
Contributor

What happened?

As part of my work on reproducible builds for openSUSE, I check that software still gives identical build results in the future.
The usual offset is +16 years, because that is how long I expect some software will be used in some places.
This showed up failing tests in our nim package build.
See https://reproducible-builds.org/ for why this matters.

Nim Version

nim-1.6.6

Current Standard Output Logs

[Suite] inet_ntop tests
 megatest:processing: [469] tests/stdlib/tnre.nim
 megatest:processing: [470] tests/stdlib/toids.nim
 oids.nim(82)             oids
 fatal.nim(53)            sysFatal
 Error: unhandled exception: value out of range: 2168246819 notin -2147483648 .. 2147483647 [RangeDefect]


### Expected Standard Output Logs

_No response_

### Possible Solution

Ensure timestamps are processed as 64-bit values.

### Additional Information

_No response_
@Araq
Copy link
Member

Araq commented Aug 30, 2022

OIDs were defined to use 32bit timestamps, there is not much we can do about it except deviating from the spec which was originally taken from MongoDB.

@bmwiedemann
Copy link
Contributor Author

bmwiedemann commented Aug 30, 2022

You could also follow python (.pyc file timestamps) and define it as timestamp&0xffffffff as long as it does not need to be continuously increasing.

@bmwiedemann
Copy link
Contributor Author

See also the fix for OIDs in BSON: https://github.com/py-bson/bson/pull/117/files

@ringabout
Copy link
Member

@bmwiedemann How does the test look like? I probably need to set one for Linux in #20338 Thank you in advance!

ringabout added a commit that referenced this issue Sep 22, 2022
ringabout added a commit that referenced this issue Sep 22, 2022
* Revert "fixes  #20285; prevent oid time overflow at year 2038"

This reverts commit dfcdb6e.

* increase time to 64 bits and clean up

* add testcase

* inline consts

* add a changelog

* fixes  #20285; prevent oid time overflow at year 2038
capocasa pushed a commit to capocasa/Nim that referenced this issue Mar 31, 2023
…g#20338)

* Revert "fixes  nim-lang#20285; prevent oid time overflow at year 2038"

This reverts commit dfcdb6e.

* increase time to 64 bits and clean up

* add testcase

* inline consts

* add a changelog

* fixes  nim-lang#20285; prevent oid time overflow at year 2038
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants