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

Index builds code can access an invalid BSONObj because the cursor was saved&restored at a lower level

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Blocker - P1 Blocker - P1
    • 5.2.0, 5.0.4, 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v5.1, v5.0
    • Execution Team 2021-10-18
    • 118

      This objToIndex BSONObj is pointing to a cursor, which can be saved/restored and no longer save the data to which objToIndex points. Save/restore was exercised further down the stack, because we were running a createIndex command on two indexes at once, so this loop further down the stack with a reference to objToIndex can hit a WCE, save/restore the cursor, and then keep trying to use the now invalid objToIndex/doc BSONObj for the second index.

      Recommendations: call getOwned() to assign a copy in objToIndex; or, update the objToIndex reference in the same lambda that restores the cursor.

            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            0 Vote for this issue
            4 Start watching this issue