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

Coverity analysis defect 105024: Macro compares unsigned to 0

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.1.4
    • None
    • Internal Code
    • Fully Compatible
    • ALL
    • Security 2018-10-08

    Description

      An unsigned value can never be less than 0

      Defect 105024 (STATIC_C)
      Checker NO_EFFECT (subcategory unsigned_compare_macros)
      File: /src/mongo/transport/service_executor_reserved.cpp
      Function mongo::transport::ServiceExecutorReserved::_startWorker()::[lambda() (instance 1)]::operator ()() const::[lambda() (instance 1)]::operator ()() const
      /src/mongo/transport/service_executor_reserved.cpp, line: 90
      This greater-than-or-equal-to-zero comparison of an unsigned value is always true. "this->__coverity_captured_this->_numRunningWorkerThreads.subtractAndFetch(1U) >= 0U".

                      invariant(_numRunningWorkerThreads.subtractAndFetch(1) >= 0);

      Attachments

        Activity

          People

            jonathan.reams@mongodb.com Jonathan Reams
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: