Bug #4478
closedtime::fromIsoString doesn't decode large dates
100%
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.
Updated by Alex Afanasyev almost 7 years ago
- Related to Bug #3915: time::toIsoString and time::toString overflow with large dates added
Updated by Alex Afanasyev almost 7 years ago
- Related to Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038 added
Updated by Davide Pesavento almost 7 years ago
- Category set to Utils
is this what causes #4476 or is it just "related"?
Updated by Alex Afanasyev almost 7 years ago
- Status changed from New to In Progress
- Assignee set to Alex Afanasyev
- % Done changed from 0 to 20
Updated by Junxiao Shi almost 7 years ago
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.
Updated by Junxiao Shi almost 7 years ago
- Related to deleted (Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038)
Updated by Junxiao Shi almost 7 years ago
- Has duplicate Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038 added
Updated by Alex Afanasyev almost 7 years ago
- Status changed from In Progress to Code review
- % Done changed from 20 to 100
Updated by Alex Afanasyev almost 7 years ago
- Has duplicate deleted (Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038)
Updated by Alex Afanasyev almost 7 years ago
- Related to Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038 added
Updated by Eric Newberry almost 7 years ago
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.
Updated by Davide Pesavento almost 7 years ago
- Status changed from Code review to Closed