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

Collection::infoCache invoked through nullptr

    • Fully Compatible
    • ALL
    • Hide

      Add an invariant(collection) before the call to collection->infoCache() in the above files, run jscore.

      Show
      Add an invariant(collection) before the call to collection->infoCache() in the above files, run jscore.
    • Query 11 (03/14/16)

      There are at least two situations where the Collection::infoCache method is called on a nullptr Collection object:

      https://github.com/mongodb/mongo/blob/ff8ca92aafd08c17f93bf00bf7aeaac79643ad02/src/mongo/db/commands/write_commands/batch_executor.cpp#L1354

      https://github.com/mongodb/mongo/blob/ff8ca92aafd08c17f93bf00bf7aeaac79643ad02/src/mongo/db/instance.cpp#L862

      Adding a

      invariant(collection)

      will cause invariant failures at these locations when running the 'core' suite. Other locations that assume that the Collection pointer is valid before calling Collection::infoCache should probably also be checked.

            Assignee:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: