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

mongodump segfaults on GetIndexes failure

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.2.0, 4.3.1
    • Affects Version/s: None
    • Component/s: mongodump
    • None
    • v4.2

      See https://github.com/mongodb/mongo-tools/blob/d7cc167b3f43f7264b6e4350a1632dd730793d6b/mongodump/metadata_dump.go#L68

      We should defer only if an error isn't returned from the `GetIndexes` call. Reproduced when running against data lake:

      $ mongodump -d test -c wild -umhuser -ppencil --authenticationDatabase admin -vvvv
      2019-06-27T08:32:43.526-0400	initializing mongodump object
      2019-06-27T08:32:43.527-0400	will listen for SIGTERM, SIGINT, and SIGKILL
      2019-06-27T08:32:43.574-0400	starting Dump()
      2019-06-27T08:32:44.857-0400	enqueued collection 'test.wild'
      2019-06-27T08:32:44.857-0400	dump phase I: metadata, indexes, users, roles, version
      2019-06-27T08:32:44.857-0400		reading indexes for `test.wild`
      panic: runtime error: invalid memory address or nil pointer dereference
      [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x14133e2]
      
      goroutine 1 [running]:
      github.com/mongodb/mongo-tools/vendor/go.mongodb.org/mongo-driver/mongo.(*Cursor).Close(0x0, 0x16c8760, 0xc00001a090, 0x0, 0x0)
      	/data/mci/40fb8f9904e99c7989355aabef2669e9/src/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/go.mongodb.org/mongo-driver/mongo/cursor.go:131 +0x22
      github.com/mongodb/mongo-tools/mongodump.(*MongoDump).dumpMetadata(0xc000012960, 0xc000202360, 0x16c6120, 0xc0000100d0, 0x16be020, 0xc0000bc680)
      	/data/mci/40fb8f9904e99c7989355aabef2669e9/src/src/mongo/gotools/src/github.com/mongodb/mongo-tools/mongodump/metadata_dump.go:70 +0xf0e
      github.com/mongodb/mongo-tools/mongodump.(*MongoDump).DumpMetadata(0xc000012960, 0x3, 0x1577475)
      	/data/mci/40fb8f9904e99c7989355aabef2669e9/src/src/mongo/gotools/src/github.com/mongodb/mongo-tools/mongodump/mongodump.go:813 +0xac
      github.com/mongodb/mongo-tools/mongodump.(*MongoDump).Dump(0xc000012960, 0x0, 0x0)
      	/data/mci/40fb8f9904e99c7989355aabef2669e9/src/src/mongo/gotools/src/github.com/mongodb/mongo-tools/mongodump/mongodump.go:313 +0x684
      main.main()
      

      This panic also causes the underlying error to be hidden from the user.

            Assignee:
            david.golden@mongodb.com David Golden
            Reporter:
            adinoyi.omuya@mongodb.com Adinoyi Omuya
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: