Project

General

Profile

Actions

Bug #4478

closed

time::fromIsoString doesn't decode large dates

Added by Alex Afanasyev almost 7 years ago. Updated almost 7 years 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 2 (0 open2 closed)

Related to ndn-cxx - Bug #3915: time::toIsoString and time::toString overflow with large datesClosedJunxiao Shi01/11/2017

Actions
Related to ndn-cxx - Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038ClosedAlex Afanasyev01/25/2018

Actions
Actions #1

Updated by Alex Afanasyev almost 7 years ago

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

Updated by Alex Afanasyev almost 7 years ago

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

Updated by Alex Afanasyev almost 7 years ago

  • Description updated (diff)
Actions #4

Updated by Davide Pesavento almost 7 years ago

  • Category set to Utils

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

Actions #5

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
Actions #6

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.

Actions #7

Updated by Junxiao Shi almost 7 years ago

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

Updated by Junxiao Shi almost 7 years ago

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

Updated by Alex Afanasyev almost 7 years ago

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

Updated by Alex Afanasyev almost 7 years ago

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

Updated by Alex Afanasyev almost 7 years ago

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

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.

Actions #13

Updated by Davide Pesavento almost 7 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF