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

Investigate swapLockState() usage

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Storage Execution
    • Fully Compatible
    • Execution EMEA Team 2023-07-24, Execution EMEA Team 2023-08-07, Execution EMEA Team 2023-08-21, Execution EMEA Team 2023-09-04, Execution EMEA Team 2023-09-18, Execution EMEA Team 2023-10-02

      There are places in the code were the Locker attached to the OperationContext is swapped out in favor of another.

      In the codebase, there is a common pattern of RAII-style classes  which execute scoped modifications to the Locker's state. A raw pointer to the Locker is stored in the constructor so the destructor can restore the Locker's original value.

      However, suppose the Locker is swapped out and discarded for a new Locker within the scope of one of these RAII-style classes. There is a risk of trying to use a pointer to a deleted object in the destructor.

            Assignee:
            haley.connelly@mongodb.com Haley Connelly
            Reporter:
            haley.connelly@mongodb.com Haley Connelly
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: