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

opWriteConcernCounters can cause undefined behavior due to overflow

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.12, 4.0.7, 4.1.9
    • Affects Version/s: 3.6.11, 4.0.6, 4.1.7
    • Component/s: Replication
    • None
    • Fully Compatible
    • ALL
    • v4.0, v3.6
    • Repl 2019-03-11

      The counters in ServerWriteConcernMetrics can overflow, since they are signed integers, and they are not protected by std::atomic. We should make these counters unsigned (preferably std::uint64_t). In order to append them to a BSONObj here, we can cast them to long long.

            Assignee:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Reporter:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: