mongo::Date_t::toTimeT() crash

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: legacy-0.0-26compat-2.6.6
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Read a date which is defined as ISODate("0001-01-01T00:00:00Z") from mongodb into a Date_t, then calling toTimeT() crashes, probably because time_t cannot represent dates before 1970 and the conversion doesn't check this.
      No exception thrown neither - try/catch block could not handle the case.

      (gdb) bt
      #0 0x00007f92545b35db in raise () from /lib64/libpthread.so.0
      #1 0x00000000006b2c47 in mongo::mongo_breakpoint() ()
      #2 0x00000000006aca17 in mongo::verifyFailed(char const*, char const*, unsigned int) ()
      #3 0x00000000006bedf4 in mongo::Date_t::toTimeT() const ()

            Assignee:
            Adam Midvidy (Inactive)
            Reporter:
            Christian Wyss
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: