Project

General

Profile

Bug #4478

time::fromIsoString doesn't decode large dates

Added by Alex Afanasyev over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Category:
Utils
Target version:
Start date:
01/25/2018
Due date:
% Done:

100%

Estimated time:

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 issues

Related to ndn-cxx - Bug #3915: time::toIsoString and time::toString overflow with large datesClosed2017-01-11

Related to ndn-cxx - Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038Closed2018-01-25

History

#1 Updated by Alex Afanasyev over 1 year ago

  • Related to Bug #3915: time::toIsoString and time::toString overflow with large dates added

#2 Updated by Alex Afanasyev over 1 year ago

  • Related to Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038 added

#3 Updated by Alex Afanasyev over 1 year ago

  • Description updated (diff)

#4 Updated by Davide Pesavento over 1 year ago

  • Category set to Utils

is this what causes #4476 or is it just "related"?

#5 Updated by Alex Afanasyev over 1 year ago

  • Status changed from New to In Progress
  • Assignee set to Alex Afanasyev
  • % Done changed from 0 to 20

#6 Updated by Junxiao Shi over 1 year 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.

#7 Updated by Junxiao Shi over 1 year ago

  • Related to deleted (Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038)

#8 Updated by Junxiao Shi over 1 year ago

  • Has duplicate Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038 added

#9 Updated by Alex Afanasyev over 1 year ago

  • Status changed from In Progress to Code review
  • % Done changed from 20 to 100

#10 Updated by Alex Afanasyev over 1 year ago

  • Has duplicate deleted (Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038)

#11 Updated by Alex Afanasyev over 1 year ago

  • Related to Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038 added

#12 Updated by Eric Newberry over 1 year 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.

#13 Updated by Davide Pesavento over 1 year ago

  • Status changed from Code review to Closed

Also available in: Atom PDF