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

The CurOp constructor should initialize its variables prior to being added to the stack of active CurOp objects

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Diagnostics
    • None
    • Fully Compatible
    • ALL
    • Execution Team 2020-12-14
    • 0

      See: https://github.com/mongodb/mongo/blob/f10e0ad7caf897b6444580d618e4a1e1577793d3/src/mongo/db/curop.cpp#L356-L371

      On L356, we call the constructor on L363 to add the CurOp object onto the stack of active CurOp objects before initializing its _lockStatsBase member variable.

      This is problematic as it makes the CurOp object available for external use before being fully initialized. For example, the currentOp command tries to access _lockStatsBase for all active CurOp objects.

            Assignee:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Reporter:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: