Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-13760

mongoexport crashes on large timestamps on Windows

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.2, 2.7.2
    • Affects Version/s: 2.6.0
    • Component/s: Tools
    • Windows
    • Hide

      1. Clean start at a shell:

      > use test
      > db.test.insert( { ts: ISODate("3001-01-01T08:00:00.000Z") } );
      

      2. Command-prompt:

      mongoexport -d test -c test
      Show
      1. Clean start at a shell: > use test > db.test.insert( { ts: ISODate("3001-01-01T08:00:00.000Z") } ); 2. Command-prompt: mongoexport -d test -c test
    • Server 2.7.1, Server 2.7.2
    • 0

      Issue Status as of May 28, 2014

      ISSUE SUMMARY
      On Windows 7 and 8, mongoexport crashes when documents to be exported contain a timestamp greater than 3001-01-01T07:59:59.999Z.

      USER IMPACT
      Documents containing these high timestamps can't be exported using mongoexport.

      WORKAROUNDS
      Use mongodump to dump collections with documents containing these large timestamps.

      AFFECTED VERSIONS
      MongoDB production releases 2.6.0 and 2.6.1 are affected by this issue.

      FIX VERSION
      The fix is included in the 2.6.2 production release.

      RESOLUTION DETAILS
      Do not attempt to convert these high timestamps to an ISO String, but export them as {"$numberLong": "<milliseconds>"} instead.

      Original description

      If a document contains a timestamp greater than 3001-01-01T07:59:59.999Z then mongoexport will crash attempting to export it when run on Windows. Known to occur on Windows 7 & 8.

      The crash dump produced by running a debug build (and following the steps to reproduce) is as follows:

      >mongoexport.exe -d test -c test
      connected to: 127.0.0.1
      2014-04-28T17:01:01.367+1000 *** C runtime error: f:\dd\vctools\crt_bld\self_64_amd64\crt\src\wcsftime.c(589) : Assertion failed: ( ( timeptr->tm_mon >=0 ) && ( timeptr->tm_mon <= 11 ) ), terminating
      2014-04-28T17:01:01.394+1000 Fatal Assertion 17006
      2014-04-28T17:01:01.851+1000 mongoexport.exe  ...\src\mongo\util\stacktrace.cpp(172)                       mongo::printStackTrace+0x5b
      2014-04-28T17:01:01.860+1000 mongoexport.exe  ...\src\mongo\util\log.cpp(127)                              mongo::logContext+0xd8
      2014-04-28T17:01:01.873+1000 mongoexport.exe  ...\src\mongo\util\assert_util.cpp(139)                      mongo::fassertFailed+0x94
      2014-04-28T17:01:01.885+1000 mongoexport.exe  ...\src\mongo\util\stacktrace.cpp(288)                       mongo::crtDebugCallback+0x107
      2014-04-28T17:01:01.898+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\dbgrptt.c(609)   _VCrtDbgReportW+0x7c1
      2014-04-28T17:01:01.914+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\dbgrpt.c(263)    _CrtDbgReportWV+0x50
      2014-04-28T17:01:01.930+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\dbgrpt.c(279)    _CrtDbgReportW+0x60
      2014-04-28T17:01:01.947+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\wcsftime.c(589)  _W_expandtime+0xaa9
      2014-04-28T17:01:01.968+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\wcsftime.c(323)  _Wcsftime_l+0x48b
      2014-04-28T17:01:01.992+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\strftime.c(285)  _Strftime_l+0x4be
      2014-04-28T17:01:02.013+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\strftime.c(190)  strftime+0x43
      2014-04-28T17:01:02.033+1000 mongoexport.exe  ...\src\mongo\util\time_support.cpp(125)                     mongo::`anonymous namespace'::_dateToISOString+0x82
      2014-04-28T17:01:02.059+1000 mongoexport.exe  ...\src\mongo\util\time_support.cpp(191)                     mongo::dateToISOStringLocal+0x5a
      2014-04-28T17:01:02.085+1000 mongoexport.exe  ...\src\mongo\db\jsobj.cpp(218)                              mongo::BSONElement::jsonString+0x12ed
      2014-04-28T17:01:02.105+1000 mongoexport.exe  ...\src\mongo\db\jsobj.cpp(479)                              mongo::BSONObj::jsonString+0x16e
      2014-04-28T17:01:02.126+1000 mongoexport.exe  ...\src\mongo\tools\export.cpp(224)                          Export::run+0xbb7
      2014-04-28T17:01:02.148+1000 mongoexport.exe  ...\src\mongo\tools\tool.cpp(143)                            mongo::Tool::main+0x4a7
      2014-04-28T17:01:02.170+1000 mongoexport.exe  ...\src\mongo\tools\tool.cpp(387)                            wmain+0xec
      2014-04-28T17:01:02.188+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\crt0.c(241)      __tmainCRTStartup+0xec
      2014-04-28T17:01:02.211+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\crt0.c(164)      wmainCRTStartup+0xe
      2014-04-28T17:01:02.232+1000
      2014-04-28T17:01:02.239+1000 *** unhandled exception 0x80000003 at 0x000007FC4712478A, terminating
      2014-04-28T17:01:02.259+1000 *** stack trace for unhandled exception:
      2014-04-28T17:01:02.709+1000 KERNELBASE.dll                                                                DebugBreak+0x2
      2014-04-28T17:01:02.722+1000 mongoexport.exe  ...\src\mongo\util\debug_util.cpp(48)                        mongo::mongo_breakpoint+0x22
      2014-04-28T17:01:02.738+1000 mongoexport.exe  ...\src\mongo\util\debug_util.h(65)                          mongo::breakpoint+0x25
      2014-04-28T17:01:02.756+1000 mongoexport.exe  ...\src\mongo\util\assert_util.cpp(140)                      mongo::fassertFailed+0x99
      2014-04-28T17:01:02.775+1000 mongoexport.exe  ...\src\mongo\util\stacktrace.cpp(288)                       mongo::crtDebugCallback+0x107
      2014-04-28T17:01:02.797+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\dbgrptt.c(609)   _VCrtDbgReportW+0x7c1
      2014-04-28T17:01:02.815+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\dbgrpt.c(263)    _CrtDbgReportWV+0x50
      2014-04-28T17:01:02.835+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\dbgrpt.c(279)    _CrtDbgReportW+0x60
      2014-04-28T17:01:02.857+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\wcsftime.c(589)  _W_expandtime+0xaa9
      2014-04-28T17:01:02.879+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\wcsftime.c(323)  _Wcsftime_l+0x48b
      2014-04-28T17:01:02.901+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\strftime.c(285)  _Strftime_l+0x4be
      2014-04-28T17:01:02.921+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\strftime.c(190)  strftime+0x43
      2014-04-28T17:01:02.941+1000 mongoexport.exe  ...\src\mongo\util\time_support.cpp(125)                     mongo::`anonymous namespace'::_dateToISOString+0x82
      2014-04-28T17:01:02.958+1000 mongoexport.exe  ...\src\mongo\util\time_support.cpp(191)                     mongo::dateToISOStringLocal+0x5a
      2014-04-28T17:01:02.971+1000 mongoexport.exe  ...\src\mongo\db\jsobj.cpp(218)                              mongo::BSONElement::jsonString+0x12ed
      2014-04-28T17:01:02.986+1000 mongoexport.exe  ...\src\mongo\db\jsobj.cpp(479)                              mongo::BSONObj::jsonString+0x16e
      2014-04-28T17:01:03.002+1000 mongoexport.exe  ...\src\mongo\tools\export.cpp(224)                          Export::run+0xbb7
      2014-04-28T17:01:03.016+1000 mongoexport.exe  ...\src\mongo\tools\tool.cpp(143)                            mongo::Tool::main+0x4a7
      2014-04-28T17:01:03.029+1000 mongoexport.exe  ...\src\mongo\tools\tool.cpp(387)                            wmain+0xec
      2014-04-28T17:01:03.044+1000 mongoexport.exe  f:\dd\vctools\crt_bld\self_64_amd64\crt\src\crt0.c(241)      __tmainCRTStartup+0xec
      2014-04-28T17:01:03.068+1000
      2014-04-28T17:01:03.074+1000 writing minidump diagnostic file C:\Users\Xarium\Documents\GitHub\mongo\mongoexport.2014-04-28T07-01-03.mdmp
      2014-04-28T17:01:03.194+1000 *** immediate exit due to unhandled exception
      

            Assignee:
            sverch Shaun Verch
            Reporter:
            andrew.ryder@mongodb.com Andrew Ryder (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: