Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-554

mongo::Date_t::toTimeT() crash

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • legacy-0.0-26compat-2.6.6
    • None

    Description

      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 ()

      Attachments

        Activity

          People

            adam.midvidy Adam Midvidy
            christian.wyss@gfk.com Christian Wyss
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: