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

nullptr dereference in CollectionImpl::initFromExisting

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • ALL
    • Execution Team 2022-12-26

      We use collection here without checking if it's nullptr. But in CollectionCatalog::_createNewPITCollection we call initFromExisting with nullptr. This causes a segmentation fault.

      At the very least we should avoid dereferencing collection if it's nullptr.

      But I think we probably actually shouldn't be calling a function initFromExisting with something that's not existing. I was actually confused the first time I came across the call site because of that. So we could also instead have an `CollectionImpl::init` function that takes a read timestamp, and use that.

            Assignee:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Reporter:
            matthew.saltz@mongodb.com Matthew Saltz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: