Bug #4478
closed
time::fromIsoString doesn't decode large dates
Added by Alex Afanasyev almost 7 years ago.
Updated almost 7 years ago.
Description
BOOST_AUTO_TEST_CASE(LargeDates)
{
auto value = fromUnixTimestamp(milliseconds(1390966967032LL));
BOOST_CHECK_EQUAL(toIsoString(value), "20140129T034247.032000");
BOOST_CHECK_EQUAL(fromIsoString("20140129T034247.032000"), value);
value += days(365 * 100 + 25 - 1); // 36524 days
BOOST_CHECK_EQUAL(toIsoString(value), "21140129T034247.032000");
BOOST_CHECK_EQUAL(fromIsoString("21140129T034247.032000"), value);
}
Expected: all tests passed
Actual:
../tests/unit-tests/util/time.t.cpp(89): error in "LargeDates": check fromIsoString("21140129T034247.032000") == value failed [251673271032000000 nanoseconds since Jan 1, 1970 != 4546640567032000000 nanoseconds since Jan 1, 1970]
Note. The issue seem to have been fixed in Boost 1.66 and later, however all Linux distributions have older versions of Boost that have the issue.
- Related to Bug #3915: time::toIsoString and time::toString overflow with large dates added
- Related to Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038 added
- Description updated (diff)
is this what causes #4476 or is it just "related"?
- Status changed from New to In Progress
- Assignee set to Alex Afanasyev
- % Done changed from 0 to 20
is this what causes #4476 or is it just "related"?
This is the cause. ValidityPeriod stores dates in ISO 8601 strings.
Note. The issue seem to have been fixed in Boost 1.66 and later, however all Linux distributions have older versions of Boost that have the issue.
The immediate solution is probably another workaround. But we should really stop wasting time on old platforms and ship everything as Docker images.
- Related to deleted (Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038)
- Has duplicate Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038 added
- Status changed from In Progress to Code review
- % Done changed from 20 to 100
- Has duplicate deleted (Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038)
- Related to Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038 added
Junxiao Shi wrote:
The immediate solution is probably another workaround. But we should really stop wasting time on old platforms and ship everything as Docker images.
I disagree strongly with not supporting NFD running directly on the OS (w/o Docker), but shipping NFD as a Docker image in addition would be a good idea. However, this is not the proper issue to discuss the pros and cons of this approach.
- Status changed from Code review to Closed
Also available in: Atom
PDF