Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-375

bsondump rewrite does not continue dumping type=debug once hitting an invalid object

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Platforms 2016-08-26

      When dumping a test .bson file with type=debug and noobjcheck with a terminating null character removed from one of the field cstrings, new bsondump exists with

      --- new object ---
      	size : 82
      2014-11-14T14:25:00.726-0500	Document is corrupted
      

      while legacy goes much deeper:

      --- new object ---
      	 size : 82
      	 OBJECT IS INVALID: invalid bson in object with _id: ObjectId('546651e74bf6e4cb017c5312')
      	 attempting to print as much as possible
      		 _id
      			 type:  7 size: 17
      		 a
      			 type:  1 size: 11
      		 b
      			 type:  2 size: 541655049
       SIZE DOES NOT WORK
      --- new object ---
      	 size : 82
      		 _id
      			 type:  7 size: 17
      		 a
      			 type:  1 size: 11
      		 b
      			 type:  2 size: 21
      		 c
      			 type: 17 size: 11
      		 d
      			 type:  5 size: 17
      --- new object ---
      	 size : 48
      		 _id
      			 type:  7 size: 17
      		 a
      			 type:  1 size: 11
      		 b
      			 type:  2 size: 15
      --- new object ---
      	 size : 71
      		 _id
      			 type:  7 size: 17
      		 a
      			 type:  1 size: 11
      		 b
      			 type:  2 size: 15
      		 c
      			 type:  3 size: 23
      			--- new object ---
      				 size : 20
      					 key
      						 type:  2 size: 15
      2014-11-14T14:25:09.313-0500 Assertion failure amt == 4 src/mongo/tools/tool.cpp 324
      2014-11-14T14:25:09.317-0500 0x10b97505a 0x10b92c164 0x10b91aa9c 0x10b913f76 0x10b250ea1 0x10b91363f 0x10b911fe9 0x10b9149e2 0x7fff86cf65c9
       0   bsondump                            0x000000010b97505a _ZN5mongo15printStackTraceERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEE + 58
       1   bsondump                            0x000000010b92c164 _ZN5mongo10logContextEPKc + 196
       2   bsondump                            0x000000010b91aa9c _ZN5mongo12verifyFailedEPKcS1_j + 412
       3   bsondump                            0x000000010b913f76 _ZN5mongo8BSONTool11processFileERKN5boost11filesystem34pathE + 2198
       4   bsondump                            0x000000010b250ea1 _ZN8BSONDump5doRunEv + 273
       5   bsondump                            0x000000010b91363f _ZN5mongo8BSONTool3runEv + 223
       6   bsondump                            0x000000010b911fe9 _ZN5mongo4Tool4mainEiPPcS2_ + 969
       7   bsondump                            0x000000010b9149e2 main + 66
       8   libdyld.dylib                       0x00007fff86cf65c9 start + 1
      assertion: 0 assertion src/mongo/tools/tool.cpp:324
      

      Ideally, new bsondump should match this level of output (maybe minus the assert failure at the end)

        1. bad_cstring.bson
          0.3 kB
        2. bad_type.bson
          0.3 kB

            Assignee:
            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            Reporter:
            kyle.erf Kyle Erf
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: