heapprofile may crash

XMLWordPrintableJSON

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

        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
              Reporter:
              deyukong
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

                Created:
                Updated:
                Resolved: