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

heapprofile may crash

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • Service Arch 2021-08-09
    • 2

        auto sortByActiveBytes = [](StackInfo* a, StackInfo* b) -> bool {
          return a->activeBytes > b->activeBytes;
        }; 
        std::stable_sort(stackInfos.begin(), stackInfos.end(), sortByActiveBytes);
      

       

      the sort functor here uses pointer to StackInfo, which is mutable, and may change during the sort procedure, violates strict weak ordering that is required by c++ standard lib and crashes.

       

      The crash behavior has been witten during the product environment.

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            wolf_kdy deyukong
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: