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

Coverity analysis defect 101169: Wrapper object use after free

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Sharding
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Sharding 2017-05-08

      Description

      An internal pointer of a wrapper object remains available after the object is freed

      Defect 101169 (STATIC_C)
      Checker WRAPPER_ESCAPE (subcategory none)
      File: /src/mongo/db/s/collection_range_deleter.cpp
      Function mongo::CollectionRangeDeleter::run()
      /src/mongo/db/s/collection_range_deleter.cpp, line: 78
      Assigning: "opCtx" = "mongo::ServiceContext::UniqueOperationContext(mongo::cc()->makeOperationContext(boost::optional<mongo::LogicalSessionId>(_INTERNAL_28_collection_range_deleter_cpp_8cd910ce::boost::none))).get()", which extracts wrapped state from temporary of type "mongo::ServiceContext::UniqueOperationContext".

              auto opCtx = cc().makeOperationContext().get();

      /src/mongo/db/s/collection_range_deleter.cpp, line: 78
      The internal representation of temporary of type "mongo::ServiceContext::UniqueOperationContext" is freed by its destructor.

              auto opCtx = cc().makeOperationContext().get();

      /src/mongo/db/s/collection_range_deleter.cpp, line: 81
      Using internal representation of destroyed object local "opCtx".

              bool hasNextRangeToClean = cleanupNextRange(opCtx, maxToDelete);

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              nathan.myers Nathan Myers
              Reporter:
              xgen-internal-coverity Coverity Collector User
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: